@kubb/adapter-oas 5.29.2 → 5.29.4
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 +9 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -8
- package/dist/index.d.ts +7 -8
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/docs/options.md +3 -6
- package/docs/overview.md +1 -1
- package/kubb-extension.json +2 -2
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -1277,12 +1277,11 @@ type ServerOptions = {
|
|
|
1277
1277
|
*/
|
|
1278
1278
|
type AdapterOasOptions = {
|
|
1279
1279
|
/**
|
|
1280
|
-
*
|
|
1281
|
-
*
|
|
1282
|
-
*
|
|
1283
|
-
* validated yet and gets one warning that says so.
|
|
1280
|
+
* Check the OpenAPI spec with `@readme/openapi-parser` while generating, and report each problem
|
|
1281
|
+
* as a `KUBB_INVALID_SPEC` warning without stopping the build. The check is off by default
|
|
1282
|
+
* because it slows down a large spec. Run `kubb validate` to check a spec on its own.
|
|
1284
1283
|
*
|
|
1285
|
-
* @default
|
|
1284
|
+
* @default false
|
|
1286
1285
|
*/
|
|
1287
1286
|
validate?: boolean;
|
|
1288
1287
|
/**
|
|
@@ -1355,9 +1354,9 @@ type AdapterOas = AdapterFactoryOptions<'oas', AdapterOasOptions, AdapterOasReso
|
|
|
1355
1354
|
export declare const adapterOasName = "oas";
|
|
1356
1355
|
/**
|
|
1357
1356
|
* Default Kubb adapter for OpenAPI 2.0, 3.0, 3.1, and 3.2 specifications. Reads the
|
|
1358
|
-
* spec from `input` (a file path, URL, inline content, or parsed object),
|
|
1359
|
-
*
|
|
1360
|
-
*
|
|
1357
|
+
* spec from `input` (a file path, URL, inline content, or parsed object), resolves
|
|
1358
|
+
* the base URL, and converts every schema and operation into the universal AST that
|
|
1359
|
+
* every downstream plugin consumes. Set `validate: true` to also check the spec.
|
|
1361
1360
|
*
|
|
1362
1361
|
* Configure once on `defineConfig`. The adapter's choices (date representation,
|
|
1363
1362
|
* integer width, server URL) apply to every plugin in the build.
|
package/dist/index.d.ts
CHANGED
|
@@ -1277,12 +1277,11 @@ type ServerOptions = {
|
|
|
1277
1277
|
*/
|
|
1278
1278
|
type AdapterOasOptions = {
|
|
1279
1279
|
/**
|
|
1280
|
-
*
|
|
1281
|
-
*
|
|
1282
|
-
*
|
|
1283
|
-
* validated yet and gets one warning that says so.
|
|
1280
|
+
* Check the OpenAPI spec with `@readme/openapi-parser` while generating, and report each problem
|
|
1281
|
+
* as a `KUBB_INVALID_SPEC` warning without stopping the build. The check is off by default
|
|
1282
|
+
* because it slows down a large spec. Run `kubb validate` to check a spec on its own.
|
|
1284
1283
|
*
|
|
1285
|
-
* @default
|
|
1284
|
+
* @default false
|
|
1286
1285
|
*/
|
|
1287
1286
|
validate?: boolean;
|
|
1288
1287
|
/**
|
|
@@ -1355,9 +1354,9 @@ type AdapterOas = AdapterFactoryOptions<'oas', AdapterOasOptions, AdapterOasReso
|
|
|
1355
1354
|
export declare const adapterOasName = "oas";
|
|
1356
1355
|
/**
|
|
1357
1356
|
* Default Kubb adapter for OpenAPI 2.0, 3.0, 3.1, and 3.2 specifications. Reads the
|
|
1358
|
-
* spec from `input` (a file path, URL, inline content, or parsed object),
|
|
1359
|
-
*
|
|
1360
|
-
*
|
|
1357
|
+
* spec from `input` (a file path, URL, inline content, or parsed object), resolves
|
|
1358
|
+
* the base URL, and converts every schema and operation into the universal AST that
|
|
1359
|
+
* every downstream plugin consumes. Set `validate: true` to also check the spec.
|
|
1361
1360
|
*
|
|
1362
1361
|
* Configure once on `defineConfig`. The adapter's choices (date representation,
|
|
1363
1362
|
* integer width, server URL) apply to every plugin in the build.
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var compatibility = {
|
|
|
14
14
|
"node": ">=22.22"
|
|
15
15
|
};
|
|
16
16
|
// package.json
|
|
17
|
-
var version = "5.29.
|
|
17
|
+
var version = "5.29.4";
|
|
18
18
|
// src/constants.ts
|
|
19
19
|
/**
|
|
20
20
|
* Default parser options applied when no explicit options are provided.
|
|
@@ -4007,8 +4007,10 @@ function convertObject({ schema, name, nullable, defaultValue, options, parse, r
|
|
|
4007
4007
|
* Converts an OAS 3.1 `prefixItems` tuple into a `TupleSchemaNode`.
|
|
4008
4008
|
*/
|
|
4009
4009
|
function convertTuple({ schema, name, nullable, defaultValue, options, parse }) {
|
|
4010
|
-
const
|
|
4011
|
-
const
|
|
4010
|
+
const prefixItems = schema.prefixItems ?? [];
|
|
4011
|
+
const isClosed = schema.maxItems !== void 0 && schema.maxItems <= prefixItems.length;
|
|
4012
|
+
const tupleItems = (isClosed ? prefixItems.slice(0, schema.maxItems) : prefixItems).map((item) => parse({ schema: item }));
|
|
4013
|
+
const tail = isClosed ? false : schema.items ?? schema.unevaluatedItems;
|
|
4012
4014
|
const rest = tail === false ? void 0 : !tail || tail === true ? ast.factory.createSchema({ type: options.unknownType }) : parse({ schema: tail });
|
|
4013
4015
|
return createNode({
|
|
4014
4016
|
schema,
|
|
@@ -4644,9 +4646,9 @@ function toInputMeta({ document, server, authSchemes }) {
|
|
|
4644
4646
|
}
|
|
4645
4647
|
/**
|
|
4646
4648
|
* Default Kubb adapter for OpenAPI 2.0, 3.0, 3.1, and 3.2 specifications. Reads the
|
|
4647
|
-
* spec from `input` (a file path, URL, inline content, or parsed object),
|
|
4648
|
-
*
|
|
4649
|
-
*
|
|
4649
|
+
* spec from `input` (a file path, URL, inline content, or parsed object), resolves
|
|
4650
|
+
* the base URL, and converts every schema and operation into the universal AST that
|
|
4651
|
+
* every downstream plugin consumes. Set `validate: true` to also check the spec.
|
|
4650
4652
|
*
|
|
4651
4653
|
* Configure once on `defineConfig`. The adapter's choices (date representation,
|
|
4652
4654
|
* integer width, server URL) apply to every plugin in the build.
|
|
@@ -4677,7 +4679,7 @@ const adapterOas = defineExtension({
|
|
|
4677
4679
|
compatibility,
|
|
4678
4680
|
issues: "https://github.com/kubb-labs/kubb/issues"
|
|
4679
4681
|
},
|
|
4680
|
-
setup: ({ validate =
|
|
4682
|
+
setup: ({ validate = false, contentType, server, discriminator = "preserve", enums = "inline", pathParamsCasing, dateType = DEFAULT_PARSER_OPTIONS.dateType, integerType = DEFAULT_PARSER_OPTIONS.integerType, unknownType = DEFAULT_PARSER_OPTIONS.unknownType, enumSuffix = DEFAULT_PARSER_OPTIONS.enumSuffix, emptySchemaType = unknownType || DEFAULT_PARSER_OPTIONS.emptySchemaType }) => ({
|
|
4681
4683
|
validate,
|
|
4682
4684
|
contentType,
|
|
4683
4685
|
server,
|