@typespec/openapi 1.7.0 → 1.8.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import type { DecoratorContext, Model, Namespace, Operation, Type } from "@typespec/compiler";
1
+ import type { DecoratorContext, DecoratorValidatorCallbacks, Model, Namespace, Operation, Type } from "@typespec/compiler";
2
2
  export interface AdditionalInfo {
3
3
  readonly [key: string]: unknown;
4
4
  readonly title?: string;
@@ -39,7 +39,7 @@ export interface ExternalDocs {
39
39
  * op read(): string;
40
40
  * ```
41
41
  */
42
- export type OperationIdDecorator = (context: DecoratorContext, target: Operation, operationId: string) => void;
42
+ export type OperationIdDecorator = (context: DecoratorContext, target: Operation, operationId: string) => DecoratorValidatorCallbacks | void;
43
43
  /**
44
44
  * Attach some custom data to the OpenAPI element generated from this type.
45
45
  *
@@ -52,7 +52,7 @@ export type OperationIdDecorator = (context: DecoratorContext, target: Operation
52
52
  * op read(): string;
53
53
  * ```
54
54
  */
55
- export type ExtensionDecorator = (context: DecoratorContext, target: Type, key: string, value: unknown) => void;
55
+ export type ExtensionDecorator = (context: DecoratorContext, target: Type, key: string, value: unknown) => DecoratorValidatorCallbacks | void;
56
56
  /**
57
57
  * Specify that this model is to be treated as the OpenAPI `default` response.
58
58
  * This differs from the compiler built-in `@error` decorator as this does not necessarily represent an error.
@@ -65,7 +65,7 @@ export type ExtensionDecorator = (context: DecoratorContext, target: Type, key:
65
65
  * op listPets(): Pet[] | PetStoreResponse;
66
66
  * ```
67
67
  */
68
- export type DefaultResponseDecorator = (context: DecoratorContext, target: Model) => void;
68
+ export type DefaultResponseDecorator = (context: DecoratorContext, target: Model) => DecoratorValidatorCallbacks | void;
69
69
  /**
70
70
  * Specify the OpenAPI `externalDocs` property for this type.
71
71
  *
@@ -77,14 +77,14 @@ export type DefaultResponseDecorator = (context: DecoratorContext, target: Model
77
77
  * op listPets(): Pet[];
78
78
  * ```
79
79
  */
80
- export type ExternalDocsDecorator = (context: DecoratorContext, target: Type, url: string, description?: string) => void;
80
+ export type ExternalDocsDecorator = (context: DecoratorContext, target: Type, url: string, description?: string) => DecoratorValidatorCallbacks | void;
81
81
  /**
82
82
  * Specify OpenAPI additional information.
83
83
  * The service `title` is already specified using `@service`.
84
84
  *
85
85
  * @param additionalInfo Additional information
86
86
  */
87
- export type InfoDecorator = (context: DecoratorContext, target: Namespace, additionalInfo: AdditionalInfo) => void;
87
+ export type InfoDecorator = (context: DecoratorContext, target: Namespace, additionalInfo: AdditionalInfo) => DecoratorValidatorCallbacks | void;
88
88
  /**
89
89
  * Specify OpenAPI additional information.
90
90
  *
@@ -97,7 +97,7 @@ export type InfoDecorator = (context: DecoratorContext, target: Namespace, addit
97
97
  * namespace PetStore {}
98
98
  * ```
99
99
  */
100
- export type TagMetadataDecorator = (context: DecoratorContext, target: Namespace, name: string, tagMetadata: TagMetadata) => void;
100
+ export type TagMetadataDecorator = (context: DecoratorContext, target: Namespace, name: string, tagMetadata: TagMetadata) => DecoratorValidatorCallbacks | void;
101
101
  export type TypeSpecOpenAPIDecorators = {
102
102
  operationId: OperationIdDecorator;
103
103
  extension: ExtensionDecorator;
@@ -1 +1 @@
1
- {"version":3,"file":"TypeSpec.OpenAPI.d.ts","sourceRoot":"","sources":["../../generated-defs/TypeSpec.OpenAPI.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE9F,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,cAAc,CAAC,EAAE,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AE,IAAI,EACZ,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,KACX,2BAA2B,GAAG,IAAI,CAAC;AAExC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACrC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,KAAK,KACV,2BAA2B,GAAG,IAAI,CAAC;AAExC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,IAAI,EACZ,GAAG,EAAE,MAAM,EACX,WAAW,CAAC,EAAE,MAAM,KACjB,2BAA2B,GAAG,IAAI,CAAC;AAExC;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,CAC1B,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,cAAc,EAAE,cAAc,KAC3B,2BAA2B,GAAG,IAAI,CAAC;AAExC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,oBAAoB,GAAG,CACjC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,WAAW,KACrB,2BAA2B,GAAG,IAAI,CAAC;AAExC,MAAM,MAAM,yBAAyB,GAAG;IACtC,WAAW,EAAE,oBAAoB,CAAC;IAClC,SAAS,EAAE,kBAAkB,CAAC;IAC9B,eAAe,EAAE,wBAAwB,CAAC;IAC1C,YAAY,EAAE,qBAAqB,CAAC;IACpC,IAAI,EAAE,aAAa,CAAC;IACpB,WAAW,EAAE,oBAAoB,CAAC;CACnC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typespec/openapi",
3
- "version": "1.7.0",
3
+ "version": "1.8.0-dev.1",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec library providing OpenAPI concepts",
6
6
  "homepage": "https://typespec.io",
@@ -39,23 +39,24 @@
39
39
  "!dist/test/**"
40
40
  ],
41
41
  "peerDependencies": {
42
- "@typespec/compiler": "^1.7.0",
42
+ "@typespec/compiler": "^1.7.1",
43
43
  "@typespec/http": "^1.7.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "~24.10.1",
47
+ "@typespec/compiler": "^1.7.1",
48
+ "@typespec/http": "^1.7.0",
49
+ "@typespec/library-linter": "^0.77.0 || >=0.78.0-dev <0.78.0",
50
+ "@typespec/rest": "^0.77.0 || >=0.78.0-dev <0.78.0",
51
+ "@typespec/tspd": "^0.73.2 || >=0.74.0-dev <0.74.0",
47
52
  "@vitest/coverage-v8": "^4.0.4",
48
53
  "@vitest/ui": "^4.0.4",
49
54
  "c8": "^10.1.3",
50
55
  "rimraf": "~6.1.2",
51
56
  "typescript": "~5.9.2",
52
- "vitest": "^4.0.4",
53
- "@typespec/http": "^1.7.0",
54
- "@typespec/compiler": "^1.7.0",
55
- "@typespec/library-linter": "^0.77.0",
56
- "@typespec/rest": "^0.77.0",
57
- "@typespec/tspd": "^0.73.2"
57
+ "vitest": "^4.0.4"
58
58
  },
59
+ "dependencies": {},
59
60
  "scripts": {
60
61
  "clean": "rimraf ./dist ./temp",
61
62
  "build": "pnpm gen-extern-signature && tsc -p . && pnpm lint-typespec-library && pnpm api-extractor",