@typespec/openapi3 0.54.0-dev.1 → 0.54.0-dev.11
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.
- package/README.md +16 -5
- package/dist/src/lib.d.ts +118 -1
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +14 -1
- package/dist/src/lib.js.map +1 -1
- package/dist/src/openapi.d.ts +14 -1
- package/dist/src/openapi.d.ts.map +1 -1
- package/dist/src/openapi.js +202 -91
- package/dist/src/openapi.js.map +1 -1
- package/dist/src/schema-emitter.d.ts.map +1 -1
- package/dist/src/schema-emitter.js +9 -2
- package/dist/src/schema-emitter.js.map +1 -1
- package/dist/src/types.d.ts +38 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/visibility-usage.d.ts.map +1 -1
- package/dist/src/visibility-usage.js +2 -1
- package/dist/src/visibility-usage.js.map +1 -1
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -86,6 +86,17 @@ By default all types declared under the service namespace will be included. With
|
|
|
86
86
|
If the generated openapi types should have the `x-typespec-name` extension set with the name of the TypeSpec type that created it.
|
|
87
87
|
This extension is meant for debugging and should not be depended on.
|
|
88
88
|
|
|
89
|
+
#### `safeint-strategy`
|
|
90
|
+
|
|
91
|
+
**Type:** `"double-int" | "int64"`
|
|
92
|
+
|
|
93
|
+
How to handle safeint type. Options are:
|
|
94
|
+
|
|
95
|
+
- `double-int`: Will produce `type: integer, format: double-int`
|
|
96
|
+
- `int64`: Will produce `type: integer, format: int64`
|
|
97
|
+
|
|
98
|
+
Default: `int64`
|
|
99
|
+
|
|
89
100
|
## Decorators
|
|
90
101
|
|
|
91
102
|
### TypeSpec.OpenAPI
|
|
@@ -103,7 +114,7 @@ Specify that `oneOf` should be used instead of `anyOf` for that union.
|
|
|
103
114
|
|
|
104
115
|
##### Target
|
|
105
116
|
|
|
106
|
-
`
|
|
117
|
+
`Union | ModelProperty`
|
|
107
118
|
|
|
108
119
|
##### Parameters
|
|
109
120
|
|
|
@@ -119,10 +130,10 @@ Specify an external reference that should be used inside of emitting this type.
|
|
|
119
130
|
|
|
120
131
|
##### Target
|
|
121
132
|
|
|
122
|
-
`
|
|
133
|
+
`Model | ModelProperty`
|
|
123
134
|
|
|
124
135
|
##### Parameters
|
|
125
136
|
|
|
126
|
-
| Name | Type
|
|
127
|
-
| ---- |
|
|
128
|
-
| ref | `valueof
|
|
137
|
+
| Name | Type | Description |
|
|
138
|
+
| ---- | ---------------- | -------------------------------------------------------------------- |
|
|
139
|
+
| ref | `valueof string` | External reference(e.g. "../../common.json#/components/schemas/Foo") |
|
package/dist/src/lib.d.ts
CHANGED
|
@@ -48,6 +48,13 @@ export interface OpenAPI3EmitterOptions {
|
|
|
48
48
|
* @default "never"
|
|
49
49
|
*/
|
|
50
50
|
"include-x-typespec-name"?: "inline-only" | "never";
|
|
51
|
+
/**
|
|
52
|
+
* How to handle safeint type. Options are:
|
|
53
|
+
* - `double-int`: Will produce `type: integer, format: double-int`
|
|
54
|
+
* - `int64`: Will produce `type: integer, format: int64`
|
|
55
|
+
* @default "int64"
|
|
56
|
+
*/
|
|
57
|
+
"safeint-strategy"?: "double-int" | "int64";
|
|
51
58
|
}
|
|
52
59
|
export declare const libDef: {
|
|
53
60
|
readonly name: "@typespec/openapi3";
|
|
@@ -221,7 +228,117 @@ export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
|
|
|
221
228
|
readonly default: import("@typespec/compiler").CallableMessage<["authType"]>;
|
|
222
229
|
};
|
|
223
230
|
}, OpenAPI3EmitterOptions, never>;
|
|
224
|
-
export declare const
|
|
231
|
+
export declare const createDiagnostic: <C extends "oneof-union" | "inconsistent-shared-route-request-visibility" | "invalid-server-variable" | "invalid-format" | "resource-namespace" | "path-query" | "duplicate-body" | "duplicate-header" | "status-code-in-default-response" | "invalid-schema" | "union-null" | "empty-union" | "empty-enum" | "enum-unique-type" | "invalid-default" | "inline-cycle" | "unsupported-status-code-range" | "unsupported-auth", M extends keyof {
|
|
232
|
+
"oneof-union": {
|
|
233
|
+
readonly default: "@oneOf decorator can only be used on a union or a model property which type is a union.";
|
|
234
|
+
};
|
|
235
|
+
"inconsistent-shared-route-request-visibility": {
|
|
236
|
+
readonly default: "All operations with `@sharedRoutes` must have the same `@requestVisibility`.";
|
|
237
|
+
};
|
|
238
|
+
"invalid-server-variable": {
|
|
239
|
+
readonly default: import("@typespec/compiler").CallableMessage<["propName"]>;
|
|
240
|
+
};
|
|
241
|
+
"invalid-format": {
|
|
242
|
+
readonly default: import("@typespec/compiler").CallableMessage<["value", "paramType"]>;
|
|
243
|
+
};
|
|
244
|
+
"resource-namespace": {
|
|
245
|
+
readonly default: "Resource goes on namespace";
|
|
246
|
+
};
|
|
247
|
+
"path-query": {
|
|
248
|
+
readonly default: "OpenAPI does not allow paths containing a query string.";
|
|
249
|
+
};
|
|
250
|
+
"duplicate-body": {
|
|
251
|
+
readonly default: "Duplicate @body declarations on response type";
|
|
252
|
+
};
|
|
253
|
+
"duplicate-header": {
|
|
254
|
+
readonly default: import("@typespec/compiler").CallableMessage<["header"]>;
|
|
255
|
+
};
|
|
256
|
+
"status-code-in-default-response": {
|
|
257
|
+
readonly default: "a default response should not have an explicit status code";
|
|
258
|
+
};
|
|
259
|
+
"invalid-schema": {
|
|
260
|
+
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
|
261
|
+
};
|
|
262
|
+
"union-null": {
|
|
263
|
+
readonly default: "Cannot have a union containing only null types.";
|
|
264
|
+
};
|
|
265
|
+
"empty-union": {
|
|
266
|
+
readonly default: "Empty unions are not supported for OpenAPI v3 - enums must have at least one value.";
|
|
267
|
+
};
|
|
268
|
+
"empty-enum": {
|
|
269
|
+
readonly default: "Empty enums are not supported for OpenAPI v3 - enums must have at least one value.";
|
|
270
|
+
};
|
|
271
|
+
"enum-unique-type": {
|
|
272
|
+
readonly default: "Enums are not supported unless all options are literals of the same type.";
|
|
273
|
+
};
|
|
274
|
+
"invalid-default": {
|
|
275
|
+
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
|
276
|
+
};
|
|
277
|
+
"inline-cycle": {
|
|
278
|
+
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
|
279
|
+
};
|
|
280
|
+
"unsupported-status-code-range": {
|
|
281
|
+
readonly default: import("@typespec/compiler").CallableMessage<["start", "end"]>;
|
|
282
|
+
};
|
|
283
|
+
"unsupported-auth": {
|
|
284
|
+
readonly default: import("@typespec/compiler").CallableMessage<["authType"]>;
|
|
285
|
+
};
|
|
286
|
+
}[C]>(diag: import("@typespec/compiler").DiagnosticReport<{
|
|
287
|
+
"oneof-union": {
|
|
288
|
+
readonly default: "@oneOf decorator can only be used on a union or a model property which type is a union.";
|
|
289
|
+
};
|
|
290
|
+
"inconsistent-shared-route-request-visibility": {
|
|
291
|
+
readonly default: "All operations with `@sharedRoutes` must have the same `@requestVisibility`.";
|
|
292
|
+
};
|
|
293
|
+
"invalid-server-variable": {
|
|
294
|
+
readonly default: import("@typespec/compiler").CallableMessage<["propName"]>;
|
|
295
|
+
};
|
|
296
|
+
"invalid-format": {
|
|
297
|
+
readonly default: import("@typespec/compiler").CallableMessage<["value", "paramType"]>;
|
|
298
|
+
};
|
|
299
|
+
"resource-namespace": {
|
|
300
|
+
readonly default: "Resource goes on namespace";
|
|
301
|
+
};
|
|
302
|
+
"path-query": {
|
|
303
|
+
readonly default: "OpenAPI does not allow paths containing a query string.";
|
|
304
|
+
};
|
|
305
|
+
"duplicate-body": {
|
|
306
|
+
readonly default: "Duplicate @body declarations on response type";
|
|
307
|
+
};
|
|
308
|
+
"duplicate-header": {
|
|
309
|
+
readonly default: import("@typespec/compiler").CallableMessage<["header"]>;
|
|
310
|
+
};
|
|
311
|
+
"status-code-in-default-response": {
|
|
312
|
+
readonly default: "a default response should not have an explicit status code";
|
|
313
|
+
};
|
|
314
|
+
"invalid-schema": {
|
|
315
|
+
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
|
316
|
+
};
|
|
317
|
+
"union-null": {
|
|
318
|
+
readonly default: "Cannot have a union containing only null types.";
|
|
319
|
+
};
|
|
320
|
+
"empty-union": {
|
|
321
|
+
readonly default: "Empty unions are not supported for OpenAPI v3 - enums must have at least one value.";
|
|
322
|
+
};
|
|
323
|
+
"empty-enum": {
|
|
324
|
+
readonly default: "Empty enums are not supported for OpenAPI v3 - enums must have at least one value.";
|
|
325
|
+
};
|
|
326
|
+
"enum-unique-type": {
|
|
327
|
+
readonly default: "Enums are not supported unless all options are literals of the same type.";
|
|
328
|
+
};
|
|
329
|
+
"invalid-default": {
|
|
330
|
+
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
|
331
|
+
};
|
|
332
|
+
"inline-cycle": {
|
|
333
|
+
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
|
334
|
+
};
|
|
335
|
+
"unsupported-status-code-range": {
|
|
336
|
+
readonly default: import("@typespec/compiler").CallableMessage<["start", "end"]>;
|
|
337
|
+
};
|
|
338
|
+
"unsupported-auth": {
|
|
339
|
+
readonly default: import("@typespec/compiler").CallableMessage<["authType"]>;
|
|
340
|
+
};
|
|
341
|
+
}, C, M>) => import("@typespec/compiler").Diagnostic, reportDiagnostic: <C extends "oneof-union" | "inconsistent-shared-route-request-visibility" | "invalid-server-variable" | "invalid-format" | "resource-namespace" | "path-query" | "duplicate-body" | "duplicate-header" | "status-code-in-default-response" | "invalid-schema" | "union-null" | "empty-union" | "empty-enum" | "enum-unique-type" | "invalid-default" | "inline-cycle" | "unsupported-status-code-range" | "unsupported-auth", M extends keyof {
|
|
225
342
|
"oneof-union": {
|
|
226
343
|
readonly default: "@oneOf decorator can only be used on a union or a model property which type is a union.";
|
|
227
344
|
};
|
package/dist/src/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,cAAc,EAAgB,MAAM,oBAAoB,C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;;;;;;;;;;;;;;;;;;;;;;;;iCAAgC,CAAC;AAClD,eAAO,MAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sDAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAE,iBAAiB,0BAAS,CAAC;AAE9E,MAAM,MAAM,cAAc,GAAG,OAAO,IAAI,CAAC"}
|
package/dist/src/lib.js
CHANGED
|
@@ -57,6 +57,19 @@ const EmitterOptionsSchema = {
|
|
|
57
57
|
default: "never",
|
|
58
58
|
description: "If the generated openapi types should have the `x-typespec-name` extension set with the name of the TypeSpec type that created it.\nThis extension is meant for debugging and should not be depended on.",
|
|
59
59
|
},
|
|
60
|
+
"safeint-strategy": {
|
|
61
|
+
type: "string",
|
|
62
|
+
enum: ["double-int", "int64"],
|
|
63
|
+
nullable: true,
|
|
64
|
+
default: "int64",
|
|
65
|
+
description: [
|
|
66
|
+
"How to handle safeint type. Options are:",
|
|
67
|
+
" - `double-int`: Will produce `type: integer, format: double-int`",
|
|
68
|
+
" - `int64`: Will produce `type: integer, format: int64`",
|
|
69
|
+
"",
|
|
70
|
+
"Default: `int64`",
|
|
71
|
+
].join("\n"),
|
|
72
|
+
},
|
|
60
73
|
},
|
|
61
74
|
required: [],
|
|
62
75
|
};
|
|
@@ -177,5 +190,5 @@ export const libDef = {
|
|
|
177
190
|
},
|
|
178
191
|
};
|
|
179
192
|
export const $lib = createTypeSpecLibrary(libDef);
|
|
180
|
-
export const { reportDiagnostic, createStateSymbol } = $lib;
|
|
193
|
+
export const { createDiagnostic, reportDiagnostic, createStateSymbol } = $lib;
|
|
181
194
|
//# sourceMappingURL=lib.js.map
|
package/dist/src/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAkB,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAkB,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAkEzF,MAAM,oBAAoB,GAA2C;IACnE,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;YACtB,QAAQ,EAAE,IAAI;YACd,WAAW,EACT,8HAA8H;SACjI;QACD,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE;gBACX,0BAA0B;gBAC1B,qDAAqD;gBACrD,mDAAmD;gBACnD,iDAAiD;gBACjD,EAAE;gBACF,yFAAyF;gBACzF,EAAE;gBACF,uCAAuC;gBACvC,oBAAoB;gBACpB,EAAE;gBACF,0CAA0C;gBAC1C,kCAAkC;gBAClC,kCAAkC;gBAClC,EAAE;gBACF,yCAAyC;gBACzC,uBAAuB;gBACvB,uBAAuB;gBACvB,EAAE;gBACF,2CAA2C;gBAC3C,qCAAqC;gBACrC,qCAAqC;gBACrC,uCAAuC;gBACvC,2CAA2C;aAC5C,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC;YACpB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,+CAA+C;SAC7D;QACD,wBAAwB,EAAE;YACxB,IAAI,EAAE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AAE;gBACR,OAAO,EAAE,YAAY,CAAA,sBAAsB,OAAO,QAAQ,KAAK,0IAA0I;aAC1M;SACF;QACD,kBAAkB,EAAE;YAClB,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,mBAAmB,UAAU,8EAA8E;aACjI;SACF;KACF;IACD,OAAO,EAAE;QACP,OAAO,EAAE,oBAA8D;KACxE;CACO,CAAC;AAEX,MAAM,CAAC,MAAM,IAAI,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAClD,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAC"}
|
package/dist/src/openapi.d.ts
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import { EmitContext, NewLine } from "@typespec/compiler";
|
|
1
|
+
import { EmitContext, NewLine, Program } from "@typespec/compiler";
|
|
2
2
|
import { FileType, OpenAPI3EmitterOptions } from "./lib.js";
|
|
3
|
+
import { OpenAPI3ServiceRecord } from "./types.js";
|
|
3
4
|
export declare function $onEmit(context: EmitContext<OpenAPI3EmitterOptions>): Promise<void>;
|
|
5
|
+
type IrrelevantOpenAPI3EmitterOptionsForObject = "file-type" | "output-file" | "new-line";
|
|
6
|
+
/**
|
|
7
|
+
* Get the OpenAPI 3 document records from the given program. The documents are
|
|
8
|
+
* returned as a JS object.
|
|
9
|
+
*
|
|
10
|
+
* @param program The program to emit to OpenAPI 3
|
|
11
|
+
* @param options OpenAPI 3 emit options
|
|
12
|
+
* @returns An array of OpenAPI 3 document records.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getOpenAPI3(program: Program, options?: Omit<OpenAPI3EmitterOptions, IrrelevantOpenAPI3EmitterOptionsForObject>): Promise<OpenAPI3ServiceRecord[]>;
|
|
4
15
|
export declare function resolveOptions(context: EmitContext<OpenAPI3EmitterOptions>): ResolvedOpenAPI3EmitterOptions;
|
|
5
16
|
export interface ResolvedOpenAPI3EmitterOptions {
|
|
6
17
|
fileType: FileType;
|
|
@@ -8,5 +19,7 @@ export interface ResolvedOpenAPI3EmitterOptions {
|
|
|
8
19
|
newLine: NewLine;
|
|
9
20
|
omitUnreachableTypes: boolean;
|
|
10
21
|
includeXTypeSpecName: "inline-only" | "never";
|
|
22
|
+
safeintStrategy: "double-int" | "int64";
|
|
11
23
|
}
|
|
24
|
+
export {};
|
|
12
25
|
//# sourceMappingURL=openapi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/openapi.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/openapi.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,WAAW,EA+BX,OAAO,EAEP,OAAO,EAQR,MAAM,oBAAoB,CAAC;AA+C5B,OAAO,EAAoB,QAAQ,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAE9E,OAAO,EAWL,qBAAqB,EAItB,MAAM,YAAY,CAAC;AAYpB,wBAAsB,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,sBAAsB,CAAC,iBAIzE;AAED,KAAK,yCAAyC,GAAG,WAAW,GAAG,aAAa,GAAG,UAAU,CAAC;AAE1F;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE,IAAI,CAAC,sBAAsB,EAAE,yCAAyC,CAAM,GACpF,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAgBlC;AAgBD,wBAAgB,cAAc,CAC5B,OAAO,EAAE,WAAW,CAAC,sBAAsB,CAAC,GAC3C,8BAA8B,CAgBhC;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,oBAAoB,EAAE,aAAa,GAAG,OAAO,CAAC;IAC9C,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC;CACzC"}
|