@kubb/plugin-oas 4.38.1 → 4.39.1

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.
@@ -1090,6 +1090,17 @@ export class SchemaGenerator<
1090
1090
  const min = schemaObject.minimum ?? schemaObject.minLength ?? schemaObject.minItems ?? undefined
1091
1091
  const max = schemaObject.maximum ?? schemaObject.maxLength ?? schemaObject.maxItems ?? undefined
1092
1092
 
1093
+ // `items: false` closes the tuple — JSON Schema forbids extra elements, so emit no rest.
1094
+ const isClosedTuple = 'items' in schemaObject && (schemaObject.items as unknown) === false
1095
+ const rest = isClosedTuple
1096
+ ? undefined
1097
+ : this.parse({
1098
+ schema: items,
1099
+ name,
1100
+ parentName,
1101
+ rootName,
1102
+ })[0]
1103
+
1093
1104
  return [
1094
1105
  {
1095
1106
  keyword: schemaKeywords.tuple,
@@ -1101,12 +1112,7 @@ export class SchemaGenerator<
1101
1112
  return this.parse({ schema: item, name, parentName, rootName })[0]
1102
1113
  })
1103
1114
  .filter((x): x is Schema => Boolean(x)),
1104
- rest: this.parse({
1105
- schema: items,
1106
- name,
1107
- parentName,
1108
- rootName,
1109
- })[0],
1115
+ rest,
1110
1116
  },
1111
1117
  },
1112
1118
  ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max),
package/src/types.ts CHANGED
@@ -96,6 +96,7 @@ export type Options = {
96
96
  oasClass?: typeof Oas
97
97
  /**
98
98
  * Define some generators next to the JSON generation
99
+ * @deprecated Removed in v5. To add custom output, build your own plugin. See https://kubb.dev/docs/5.x/migration-guide
99
100
  */
100
101
  generators?: Array<Generator<PluginOas>>
101
102
  /**