@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 CHANGED
@@ -15,7 +15,7 @@ var compatibility = {
15
15
  "node": ">=22.22"
16
16
  };
17
17
  // package.json
18
- var version = "5.29.2";
18
+ var version = "5.29.4";
19
19
  // src/constants.ts
20
20
  /**
21
21
  * Default parser options applied when no explicit options are provided.
@@ -4008,8 +4008,10 @@ function convertObject({ schema, name, nullable, defaultValue, options, parse, r
4008
4008
  * Converts an OAS 3.1 `prefixItems` tuple into a `TupleSchemaNode`.
4009
4009
  */
4010
4010
  function convertTuple({ schema, name, nullable, defaultValue, options, parse }) {
4011
- const tupleItems = (schema.prefixItems ?? []).map((item) => parse({ schema: item }));
4012
- const tail = schema.items ?? schema.unevaluatedItems;
4011
+ const prefixItems = schema.prefixItems ?? [];
4012
+ const isClosed = schema.maxItems !== void 0 && schema.maxItems <= prefixItems.length;
4013
+ const tupleItems = (isClosed ? prefixItems.slice(0, schema.maxItems) : prefixItems).map((item) => parse({ schema: item }));
4014
+ const tail = isClosed ? false : schema.items ?? schema.unevaluatedItems;
4013
4015
  const rest = tail === false ? void 0 : !tail || tail === true ? _kubb_kit.ast.factory.createSchema({ type: options.unknownType }) : parse({ schema: tail });
4014
4016
  return createNode({
4015
4017
  schema,
@@ -4645,9 +4647,9 @@ function toInputMeta({ document, server, authSchemes }) {
4645
4647
  }
4646
4648
  /**
4647
4649
  * Default Kubb adapter for OpenAPI 2.0, 3.0, 3.1, and 3.2 specifications. Reads the
4648
- * spec from `input` (a file path, URL, inline content, or parsed object), validates
4649
- * it, resolves the base URL, and converts every schema and operation into the
4650
- * universal AST that every downstream plugin consumes.
4650
+ * spec from `input` (a file path, URL, inline content, or parsed object), resolves
4651
+ * the base URL, and converts every schema and operation into the universal AST that
4652
+ * every downstream plugin consumes. Set `validate: true` to also check the spec.
4651
4653
  *
4652
4654
  * Configure once on `defineConfig`. The adapter's choices (date representation,
4653
4655
  * integer width, server URL) apply to every plugin in the build.
@@ -4678,7 +4680,7 @@ const adapterOas = (0, _kubb_core.defineExtension)({
4678
4680
  compatibility,
4679
4681
  issues: "https://github.com/kubb-labs/kubb/issues"
4680
4682
  },
4681
- setup: ({ validate = true, 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 }) => ({
4683
+ 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 }) => ({
4682
4684
  validate,
4683
4685
  contentType,
4684
4686
  server,