@kubb/adapter-oas 5.29.3 → 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.js CHANGED
@@ -14,7 +14,7 @@ var compatibility = {
14
14
  "node": ">=22.22"
15
15
  };
16
16
  // package.json
17
- var version = "5.29.3";
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 tupleItems = (schema.prefixItems ?? []).map((item) => parse({ schema: item }));
4011
- const tail = schema.items ?? schema.unevaluatedItems;
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,