@typespec/openapi3
Advanced tools
Comparing version 0.54.0-dev.9 to 0.54.0-dev.10
@@ -51,2 +51,9 @@ import { JSONSchemaType } from "@typespec/compiler"; | ||
"include-x-typespec-name"?: "inline-only" | "never"; | ||
/** | ||
* How to handle safeint type. Options are: | ||
* - `double-int`: Will produce `type: integer, format: double-int` | ||
* - `int64`: Will produce `type: integer, format: int64` | ||
* @default "int64" | ||
*/ | ||
"safeint-strategy"?: "double-int" | "int64"; | ||
} | ||
@@ -53,0 +60,0 @@ export declare const libDef: { |
@@ -60,2 +60,15 @@ import { createTypeSpecLibrary, paramMessage } from "@typespec/compiler"; | ||
}, | ||
"safeint-strategy": { | ||
type: "string", | ||
enum: ["double-int", "int64"], | ||
nullable: true, | ||
default: "int64", | ||
description: [ | ||
"How to handle safeint type. Options are:", | ||
" - `double-int`: Will produce `type: integer, format: double-int`", | ||
" - `int64`: Will produce `type: integer, format: int64`", | ||
"", | ||
"Default: `int64`", | ||
].join("\n"), | ||
}, | ||
}, | ||
@@ -62,0 +75,0 @@ required: [], |
@@ -22,4 +22,5 @@ import { EmitContext, NewLine, Program } from "@typespec/compiler"; | ||
includeXTypeSpecName: "inline-only" | "never"; | ||
safeintStrategy: "double-int" | "int64"; | ||
} | ||
export {}; | ||
//# sourceMappingURL=openapi.d.ts.map |
@@ -17,2 +17,3 @@ import { compilerAssert, createDiagnosticCollector, emitFile, getAllTags, getAnyExtensionFromPath, getDoc, getEncode, getFormat, getKnownValues, getMaxItems, getMaxLength, getMaxValue, getMaxValueExclusive, getMinItems, getMinLength, getMinValue, getMinValueExclusive, getNamespaceFullName, getPattern, getService, getSummary, ignoreDiagnostics, interpolatePath, isDeprecated, isGlobalNamespace, isNeverType, isSecret, isVoidType, listServices, navigateTypesInNamespace, projectProgram, resolvePath, } from "@typespec/compiler"; | ||
"include-x-typespec-name": "never", | ||
"safeint-strategy": "int64", | ||
}; | ||
@@ -70,2 +71,3 @@ export async function $onEmit(context) { | ||
includeXTypeSpecName: resolvedOptions["include-x-typespec-name"], | ||
safeintStrategy: resolvedOptions["safeint-strategy"], | ||
outputFile: resolvePath(context.emitterOutputDir, outputFile), | ||
@@ -72,0 +74,0 @@ }; |
@@ -528,3 +528,9 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { | ||
case "safeint": | ||
return { type: "integer", format: "int64" }; | ||
switch (__classPrivateFieldGet(this, _OpenAPI3SchemaEmitter_options, "f").safeintStrategy) { | ||
case "double-int": | ||
return { type: "integer", format: "double-int" }; | ||
case "int64": | ||
default: | ||
return { type: "integer", format: "int64" }; | ||
} | ||
case "uint8": | ||
@@ -531,0 +537,0 @@ return { type: "integer", format: "uint8" }; |
{ | ||
"name": "@typespec/openapi3", | ||
"version": "0.54.0-dev.9", | ||
"version": "0.54.0-dev.10", | ||
"author": "Microsoft Corporation", | ||
@@ -5,0 +5,0 @@ "description": "TypeSpec library for emitting OpenAPI 3.0 from the TypeSpec REST protocol binding", |
@@ -89,2 +89,13 @@ # @typespec/openapi3 | ||
#### `safeint-strategy` | ||
**Type:** `"double-int" | "int64"` | ||
How to handle safeint type. Options are: | ||
- `double-int`: Will produce `type: integer, format: double-int` | ||
- `int64`: Will produce `type: integer, format: int64` | ||
Default: `int64` | ||
## Decorators | ||
@@ -91,0 +102,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
277946
3634
140