@kubb/adapter-oas 5.0.0-beta.104 → 5.0.0-beta.105
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/dist/index.cjs +5 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -84,12 +84,13 @@ const structuralKeys = /* @__PURE__ */ new Set([
|
|
|
84
84
|
]);
|
|
85
85
|
/**
|
|
86
86
|
* Formats `convertFormat` maps to a dedicated type without going through `formatMap`:
|
|
87
|
-
* `int64` and the date/time family. Keep this in sync with the `convertFormat`
|
|
87
|
+
* `int64`, `uint64` and the date/time family. Keep this in sync with the `convertFormat`
|
|
88
88
|
* special-cases in `parser.ts`. `isHandledFormat` reads it so the
|
|
89
89
|
* `KUBB_UNSUPPORTED_FORMAT` diagnostic and the parser agree on what is handled.
|
|
90
90
|
*/
|
|
91
91
|
const specialCasedFormats = /* @__PURE__ */ new Set([
|
|
92
92
|
"int64",
|
|
93
|
+
"uint64",
|
|
93
94
|
"date-time",
|
|
94
95
|
"date",
|
|
95
96
|
"time"
|
|
@@ -844,14 +845,14 @@ function getOperations(document, refs) {
|
|
|
844
845
|
//#region src/emit/schemaShape.ts
|
|
845
846
|
/**
|
|
846
847
|
* Returns the Kubb `SchemaType` for a given OAS `format` string, or `null` if not found.
|
|
847
|
-
* Formats not in `formatMap` (e.g., `int64`, `date-time`) are handled separately by parser options.
|
|
848
|
+
* Formats not in `formatMap` (e.g., `int64`, `uint64`, `date-time`) are handled separately by parser options.
|
|
848
849
|
*/
|
|
849
850
|
function getSchemaType(format) {
|
|
850
851
|
return formatMap[format] ?? null;
|
|
851
852
|
}
|
|
852
853
|
/**
|
|
853
854
|
* Whether the parser maps `format` to a dedicated type. True for any `formatMap` entry, plus the
|
|
854
|
-
* `specialCasedFormats` that `convertFormat` handles directly. False means the format falls back to
|
|
855
|
+
* `specialCasedFormats` that `convertFormat` handles directly (int64, uint64, date-time, date, time). False means the format falls back to
|
|
855
856
|
* the base type, which is what `KUBB_UNSUPPORTED_FORMAT` flags. Reading both sources keeps the
|
|
856
857
|
* diagnostic in step with the parser as `formatMap` grows.
|
|
857
858
|
*/
|
|
@@ -1369,7 +1370,7 @@ function convertFormat({ schema, name, nullable, defaultValue, options }) {
|
|
|
1369
1370
|
nullable,
|
|
1370
1371
|
defaultValue
|
|
1371
1372
|
};
|
|
1372
|
-
if (schema.format === "int64") return createNode(ctx, {
|
|
1373
|
+
if (schema.format === "int64" || schema.format === "uint64") return createNode(ctx, {
|
|
1373
1374
|
type: options.integerType === "bigint" ? "bigint" : "integer",
|
|
1374
1375
|
primitive: "integer",
|
|
1375
1376
|
min: schema.minimum,
|