@kubb/plugin-oas 3.14.0 → 3.14.3
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/{OperationGenerator-BOGaYlxq.d.ts → OperationGenerator-DyM5QANw.d.ts} +1 -0
- package/dist/{OperationGenerator-BaR07RkP.d.cts → OperationGenerator-LFwakDt7.d.cts} +1 -0
- package/dist/{chunk-HBZVPYJH.cjs → chunk-5VCNZ3TT.cjs} +75 -24
- package/dist/chunk-5VCNZ3TT.cjs.map +1 -0
- package/dist/{chunk-ZJMQ57BF.js → chunk-DDS4UI73.js} +75 -24
- package/dist/chunk-DDS4UI73.js.map +1 -0
- package/dist/components.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/generators.d.cts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/hooks.cjs +2 -2
- package/dist/hooks.d.cts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/package.json +7 -7
- package/src/SchemaGenerator.ts +85 -28
- package/dist/chunk-HBZVPYJH.cjs.map +0 -1
- package/dist/chunk-ZJMQ57BF.js.map +0 -1
package/dist/generators.d.cts
CHANGED
package/dist/generators.d.ts
CHANGED
package/dist/hooks.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk5VCNZ3TT_cjs = require('./chunk-5VCNZ3TT.cjs');
|
|
4
4
|
var chunkYWMMI3MO_cjs = require('./chunk-YWMMI3MO.cjs');
|
|
5
5
|
require('./chunk-ZVFL3NXX.cjs');
|
|
6
6
|
var chunkZ2NREI4X_cjs = require('./chunk-Z2NREI4X.cjs');
|
|
@@ -188,7 +188,7 @@ function useSchemaManager() {
|
|
|
188
188
|
};
|
|
189
189
|
};
|
|
190
190
|
const getImports = (tree) => {
|
|
191
|
-
const refs =
|
|
191
|
+
const refs = chunk5VCNZ3TT_cjs.SchemaGenerator.deepSearch(tree, chunkYWMMI3MO_cjs.schemaKeywords.ref);
|
|
192
192
|
return refs?.map((item) => {
|
|
193
193
|
if (!item.args.path || !item.args.isImportable) {
|
|
194
194
|
return void 0;
|
package/dist/hooks.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Oas, Operation, HttpMethod } from '@kubb/oas';
|
|
2
2
|
import { Plugin, ResolveNameParams, FileMetaBase } from '@kubb/core';
|
|
3
3
|
import { KubbFile } from '@kubb/core/fs';
|
|
4
|
-
import { o as OperationSchemas } from './OperationGenerator-
|
|
4
|
+
import { o as OperationSchemas } from './OperationGenerator-LFwakDt7.cjs';
|
|
5
5
|
import { a as SchemaContextProps } from './Schema-M6983FL1.cjs';
|
|
6
6
|
import { S as Schema } from './SchemaMapper-B21ZmWag.cjs';
|
|
7
7
|
import '@kubb/react/types';
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Oas, Operation, HttpMethod } from '@kubb/oas';
|
|
2
2
|
import { Plugin, ResolveNameParams, FileMetaBase } from '@kubb/core';
|
|
3
3
|
import { KubbFile } from '@kubb/core/fs';
|
|
4
|
-
import { o as OperationSchemas } from './OperationGenerator-
|
|
4
|
+
import { o as OperationSchemas } from './OperationGenerator-DyM5QANw.js';
|
|
5
5
|
import { a as SchemaContextProps } from './Schema-AjebpeVY.js';
|
|
6
6
|
import { S as Schema } from './SchemaMapper-B21ZmWag.js';
|
|
7
7
|
import '@kubb/react/types';
|
package/dist/hooks.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var chunkRSHQODEK_cjs = require('./chunk-RSHQODEK.cjs');
|
|
4
4
|
var chunkS3UPJP7I_cjs = require('./chunk-S3UPJP7I.cjs');
|
|
5
5
|
require('./chunk-DTD4ZUDA.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunk5VCNZ3TT_cjs = require('./chunk-5VCNZ3TT.cjs');
|
|
7
7
|
var chunkYWMMI3MO_cjs = require('./chunk-YWMMI3MO.cjs');
|
|
8
8
|
require('./chunk-ZVFL3NXX.cjs');
|
|
9
9
|
require('./chunk-Z2NREI4X.cjs');
|
|
@@ -353,7 +353,7 @@ var pluginOas = core.createPlugin((options) => {
|
|
|
353
353
|
logger: this.logger
|
|
354
354
|
});
|
|
355
355
|
await oas2.dereference();
|
|
356
|
-
const schemaGenerator = new
|
|
356
|
+
const schemaGenerator = new chunk5VCNZ3TT_cjs.SchemaGenerator(
|
|
357
357
|
{
|
|
358
358
|
unknownType: "unknown",
|
|
359
359
|
emptySchemaType: "unknown",
|
|
@@ -400,7 +400,7 @@ Object.defineProperty(exports, "createReactGenerator", {
|
|
|
400
400
|
});
|
|
401
401
|
Object.defineProperty(exports, "SchemaGenerator", {
|
|
402
402
|
enumerable: true,
|
|
403
|
-
get: function () { return
|
|
403
|
+
get: function () { return chunk5VCNZ3TT_cjs.SchemaGenerator; }
|
|
404
404
|
});
|
|
405
405
|
Object.defineProperty(exports, "isKeyword", {
|
|
406
406
|
enumerable: true,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as Options, P as PluginOas } from './OperationGenerator-
|
|
2
|
-
export { A as API, E as Exclude, h as Generator, i as GeneratorOptions, G as GetSchemaGeneratorOptions, I as Include, b as OperationGenerator, a as OperationMethodResult, n as OperationSchema, o as OperationSchemas, p as OperationsByMethod, q as Override, R as ReactGeneratorOptions, k as Ref, l as Refs, j as ResolvePathOptions, m as Resolver, e as SchemaGenerator, S as SchemaGeneratorBuildOptions, c as SchemaGeneratorOptions, d as SchemaMethodResult, f as createGenerator, g as createReactGenerator } from './OperationGenerator-
|
|
1
|
+
import { O as Options, P as PluginOas } from './OperationGenerator-LFwakDt7.cjs';
|
|
2
|
+
export { A as API, E as Exclude, h as Generator, i as GeneratorOptions, G as GetSchemaGeneratorOptions, I as Include, b as OperationGenerator, a as OperationMethodResult, n as OperationSchema, o as OperationSchemas, p as OperationsByMethod, q as Override, R as ReactGeneratorOptions, k as Ref, l as Refs, j as ResolvePathOptions, m as Resolver, e as SchemaGenerator, S as SchemaGeneratorBuildOptions, c as SchemaGeneratorOptions, d as SchemaMethodResult, f as createGenerator, g as createReactGenerator } from './OperationGenerator-LFwakDt7.cjs';
|
|
3
3
|
import * as _kubb_core from '@kubb/core';
|
|
4
4
|
export { S as Schema, b as SchemaKeyword, c as SchemaKeywordBase, d as SchemaKeywordMapper, e as SchemaMapper, a as SchemaTree, i as isKeyword, s as schemaKeywords } from './SchemaMapper-B21ZmWag.cjs';
|
|
5
5
|
import '@kubb/core/fs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as Options, P as PluginOas } from './OperationGenerator-
|
|
2
|
-
export { A as API, E as Exclude, h as Generator, i as GeneratorOptions, G as GetSchemaGeneratorOptions, I as Include, b as OperationGenerator, a as OperationMethodResult, n as OperationSchema, o as OperationSchemas, p as OperationsByMethod, q as Override, R as ReactGeneratorOptions, k as Ref, l as Refs, j as ResolvePathOptions, m as Resolver, e as SchemaGenerator, S as SchemaGeneratorBuildOptions, c as SchemaGeneratorOptions, d as SchemaMethodResult, f as createGenerator, g as createReactGenerator } from './OperationGenerator-
|
|
1
|
+
import { O as Options, P as PluginOas } from './OperationGenerator-DyM5QANw.js';
|
|
2
|
+
export { A as API, E as Exclude, h as Generator, i as GeneratorOptions, G as GetSchemaGeneratorOptions, I as Include, b as OperationGenerator, a as OperationMethodResult, n as OperationSchema, o as OperationSchemas, p as OperationsByMethod, q as Override, R as ReactGeneratorOptions, k as Ref, l as Refs, j as ResolvePathOptions, m as Resolver, e as SchemaGenerator, S as SchemaGeneratorBuildOptions, c as SchemaGeneratorOptions, d as SchemaMethodResult, f as createGenerator, g as createReactGenerator } from './OperationGenerator-DyM5QANw.js';
|
|
3
3
|
import * as _kubb_core from '@kubb/core';
|
|
4
4
|
export { S as Schema, b as SchemaKeyword, c as SchemaKeywordBase, d as SchemaKeywordMapper, e as SchemaMapper, a as SchemaTree, i as isKeyword, s as schemaKeywords } from './SchemaMapper-B21ZmWag.js';
|
|
5
5
|
import '@kubb/core/fs';
|
package/dist/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import { parseFromConfig } from './chunk-QF3E6S2N.js';
|
|
|
2
2
|
import { jsonGenerator } from './chunk-S7ZYTJXL.js';
|
|
3
3
|
export { createGenerator, createReactGenerator } from './chunk-S7ZYTJXL.js';
|
|
4
4
|
import './chunk-6S7YFY6F.js';
|
|
5
|
-
import { SchemaGenerator } from './chunk-
|
|
6
|
-
export { SchemaGenerator } from './chunk-
|
|
5
|
+
import { SchemaGenerator } from './chunk-DDS4UI73.js';
|
|
6
|
+
export { SchemaGenerator } from './chunk-DDS4UI73.js';
|
|
7
7
|
export { isKeyword, schemaKeywords } from './chunk-76E35IZ2.js';
|
|
8
8
|
import './chunk-PORSNYI5.js';
|
|
9
9
|
import './chunk-JNN4JPWK.js';
|
package/dist/utils.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { Operation, Oas, SchemaObject, OpenAPIV3, OpenAPIV3_1, contentType, OasT
|
|
|
2
2
|
export { isOptional } from '@kubb/oas';
|
|
3
3
|
import { FunctionParamsAST } from '@kubb/core/utils';
|
|
4
4
|
import { Params } from '@kubb/react/types';
|
|
5
|
-
import { n as OperationSchema } from './OperationGenerator-
|
|
5
|
+
import { n as OperationSchema } from './OperationGenerator-LFwakDt7.cjs';
|
|
6
6
|
import { Config, Output } from '@kubb/core';
|
|
7
7
|
import '@kubb/core/fs';
|
|
8
8
|
import './SchemaMapper-B21ZmWag.cjs';
|
package/dist/utils.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Operation, Oas, SchemaObject, OpenAPIV3, OpenAPIV3_1, contentType, OasT
|
|
|
2
2
|
export { isOptional } from '@kubb/oas';
|
|
3
3
|
import { FunctionParamsAST } from '@kubb/core/utils';
|
|
4
4
|
import { Params } from '@kubb/react/types';
|
|
5
|
-
import { n as OperationSchema } from './OperationGenerator-
|
|
5
|
+
import { n as OperationSchema } from './OperationGenerator-DyM5QANw.js';
|
|
6
6
|
import { Config, Output } from '@kubb/core';
|
|
7
7
|
import '@kubb/core/fs';
|
|
8
8
|
import './SchemaMapper-B21ZmWag.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-oas",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.3",
|
|
4
4
|
"description": "OpenAPI Specification (OAS) plugin for Kubb, providing core functionality for parsing and processing OpenAPI/Swagger schemas for code generation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openapi",
|
|
@@ -87,18 +87,18 @@
|
|
|
87
87
|
],
|
|
88
88
|
"dependencies": {
|
|
89
89
|
"@stoplight/yaml": "^4.3.0",
|
|
90
|
-
"remeda": "^2.
|
|
91
|
-
"@kubb/core": "3.14.
|
|
92
|
-
"@kubb/oas": "3.14.
|
|
93
|
-
"@kubb/react": "3.14.
|
|
90
|
+
"remeda": "^2.25.0",
|
|
91
|
+
"@kubb/core": "3.14.3",
|
|
92
|
+
"@kubb/oas": "3.14.3",
|
|
93
|
+
"@kubb/react": "3.14.3"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
96
|
"@types/react": "^18.3.23",
|
|
97
97
|
"react": "^18.3.1",
|
|
98
98
|
"tsup": "^8.5.0",
|
|
99
99
|
"typescript": "^5.8.3",
|
|
100
|
-
"@kubb/config-ts": "3.14.
|
|
101
|
-
"@kubb/config-tsup": "3.14.
|
|
100
|
+
"@kubb/config-ts": "3.14.3",
|
|
101
|
+
"@kubb/config-tsup": "3.14.3"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
104
|
"@kubb/react": "^3.0.0"
|
package/src/SchemaGenerator.ts
CHANGED
|
@@ -211,6 +211,58 @@ export class SchemaGenerator<
|
|
|
211
211
|
return foundItem
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
+
static combineObjects(tree: Schema[] | undefined): Schema[] {
|
|
215
|
+
if (!tree) {
|
|
216
|
+
return []
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return tree.map((schema) => {
|
|
220
|
+
if (!isKeyword(schema, schemaKeywords.and)) {
|
|
221
|
+
return schema
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
let mergedProperties: Record<string, Schema[]> | null = null
|
|
225
|
+
let mergedAdditionalProps: Schema[] = []
|
|
226
|
+
|
|
227
|
+
const newArgs: Schema[] = []
|
|
228
|
+
|
|
229
|
+
for (const subSchema of schema.args) {
|
|
230
|
+
if (isKeyword(subSchema, schemaKeywords.object)) {
|
|
231
|
+
const { properties = {}, additionalProperties = [] } = subSchema.args ?? {}
|
|
232
|
+
|
|
233
|
+
if (!mergedProperties) {
|
|
234
|
+
mergedProperties = {}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
for (const [key, value] of Object.entries(properties)) {
|
|
238
|
+
mergedProperties[key] = value
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (additionalProperties.length > 0) {
|
|
242
|
+
mergedAdditionalProps = additionalProperties
|
|
243
|
+
}
|
|
244
|
+
} else {
|
|
245
|
+
newArgs.push(subSchema)
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (mergedProperties) {
|
|
250
|
+
newArgs.push({
|
|
251
|
+
keyword: schemaKeywords.object,
|
|
252
|
+
args: {
|
|
253
|
+
properties: mergedProperties,
|
|
254
|
+
additionalProperties: mergedAdditionalProps,
|
|
255
|
+
},
|
|
256
|
+
})
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return {
|
|
260
|
+
keyword: schemaKeywords.and,
|
|
261
|
+
args: newArgs,
|
|
262
|
+
}
|
|
263
|
+
})
|
|
264
|
+
}
|
|
265
|
+
|
|
214
266
|
#getUsedEnumNames(props: SchemaProps) {
|
|
215
267
|
const options = this.#getOptions(props)
|
|
216
268
|
|
|
@@ -630,49 +682,54 @@ export class SchemaGenerator<
|
|
|
630
682
|
.filter((item) => !isKeyword(item, schemaKeywords.unknown)),
|
|
631
683
|
}
|
|
632
684
|
|
|
633
|
-
if (schemaWithoutAllOf.required) {
|
|
634
|
-
|
|
635
|
-
const
|
|
636
|
-
.map((item) => {
|
|
637
|
-
if (isReference(item)) {
|
|
638
|
-
return this.context.oas.get(item.$ref) as SchemaObject
|
|
639
|
-
}
|
|
640
|
-
})
|
|
641
|
-
.filter(Boolean)
|
|
685
|
+
if (schemaWithoutAllOf.required?.length) {
|
|
686
|
+
const allOfItems = schemaObject.allOf
|
|
687
|
+
const resolvedSchemas: SchemaObject[] = []
|
|
642
688
|
|
|
643
|
-
const
|
|
644
|
-
.
|
|
645
|
-
// filter out keys that are already part of the properties(reduce duplicated keys(https://github.com/kubb-labs/kubb/issues/1492)
|
|
646
|
-
if (schemaWithoutAllOf.properties) {
|
|
647
|
-
return !Object.keys(schemaWithoutAllOf.properties).includes(key)
|
|
648
|
-
}
|
|
689
|
+
for (const item of allOfItems) {
|
|
690
|
+
const resolved = isReference(item) ? (this.context.oas.get(item.$ref) as SchemaObject) : item
|
|
649
691
|
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
const schema = schemas.find((item) => item.properties && Object.keys(item.properties).find((propertyKey) => propertyKey === key))
|
|
692
|
+
if (resolved) {
|
|
693
|
+
resolvedSchemas.push(resolved)
|
|
694
|
+
}
|
|
695
|
+
}
|
|
655
696
|
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
697
|
+
const existingKeys = schemaWithoutAllOf.properties ? new Set(Object.keys(schemaWithoutAllOf.properties)) : null
|
|
698
|
+
|
|
699
|
+
const parsedItems: SchemaObject[] = []
|
|
700
|
+
|
|
701
|
+
for (const key of schemaWithoutAllOf.required) {
|
|
702
|
+
if (existingKeys?.has(key)) {
|
|
703
|
+
continue
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
for (const schema of resolvedSchemas) {
|
|
707
|
+
if (schema.properties?.[key]) {
|
|
708
|
+
parsedItems.push({
|
|
659
709
|
properties: {
|
|
660
710
|
[key]: schema.properties[key],
|
|
661
711
|
},
|
|
662
712
|
required: [key],
|
|
663
|
-
}
|
|
713
|
+
} as SchemaObject)
|
|
714
|
+
break
|
|
664
715
|
}
|
|
665
|
-
}
|
|
666
|
-
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
for (const item of parsedItems) {
|
|
720
|
+
const parsed = this.parse({ schemaObject: item, name, parentName })
|
|
667
721
|
|
|
668
|
-
|
|
722
|
+
if (Array.isArray(parsed)) {
|
|
723
|
+
and.args = and.args ? and.args.concat(parsed) : parsed
|
|
724
|
+
}
|
|
725
|
+
}
|
|
669
726
|
}
|
|
670
727
|
|
|
671
728
|
if (schemaWithoutAllOf.properties) {
|
|
672
729
|
and.args = [...(and.args || []), ...this.parse({ schemaObject: schemaWithoutAllOf, name, parentName })]
|
|
673
730
|
}
|
|
674
731
|
|
|
675
|
-
return [and, ...baseItems]
|
|
732
|
+
return SchemaGenerator.combineObjects([and, ...baseItems])
|
|
676
733
|
}
|
|
677
734
|
|
|
678
735
|
if (schemaObject.enum) {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/SchemaGenerator.ts"],"names":["BaseGenerator","uniqueWith","isDeepEqual","isKeyword","schemaKeywords","isDiscriminator","getUniqueName","getSchemaFactory","isNullable","transformers","isReference","pascalCase","name","isNumber","min","max","getSchemas"],"mappings":";;;;;;;;;;;;;;AAgEa,IAAA,eAAA,GAAN,MAAM,gBAAA,SAIHA,kBAA2D,CAAA;AAAA;AAAA,EAEnE,OAAa,EAAC;AAAA;AAAA,EA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A,UACV,MAAQ,EAAA;AAAA,YACN,IAAA;AAAA,YACA,KAAA;AAAA,YACA;AAAA,WACF;AAAA,UACA,OAAS,EAAA;AAAA,YACP,GAAG,IAAK,CAAA,OAAA;AAAA,YACR,GAAG;AAAA;AACL,SACM,CAAA;AAER,QAAA,IAAI,OAAS,EAAA;AACX,UAAA,GAAA,CAAI,KAAK,OAAO,CAAA;AAAA;AAClB,OACD,CAAA;AAED,MAAO,OAAA,GAAA;AAAA,KACT,EAAG,EAAqC,CAAA;AAExC,IAAA,MAAM,KAAQ,GAAA,MAAM,OAAQ,CAAA,GAAA,CAAI,QAAQ,CAAA;AAGxC,IAAA,OAAO,KAAM,CAAA,IAAA,EAAO,CAAA,MAAA,CAAO,OAAO,CAAA;AAAA;AACpC;AAAA;AAAA;AAAA,EAKA,MAAM,MAAA,CAAO,KAAe,EAAA,OAAA,EAAuB,QAAmD,EAAA;AACpG,IAAA,OAAO,EAAC;AAAA;AAEZ","file":"chunk-HBZVPYJH.cjs","sourcesContent":["import type { Plugin, PluginFactoryOptions, PluginManager, ResolveNameParams } from '@kubb/core'\nimport { BaseGenerator, type FileMetaBase } from '@kubb/core'\nimport type { KubbFile } from '@kubb/core/fs'\nimport transformers, { pascalCase } from '@kubb/core/transformers'\nimport { getUniqueName } from '@kubb/core/utils'\nimport type { contentType, Oas, OpenAPIV3, SchemaObject } from '@kubb/oas'\nimport { isDiscriminator, isNullable, isReference } from '@kubb/oas'\nimport { isDeepEqual, isNumber, uniqueWith } from 'remeda'\nimport type { Generator } from './generator.tsx'\nimport type { Schema, SchemaKeywordMapper } from './SchemaMapper.ts'\nimport { isKeyword, schemaKeywords } from './SchemaMapper.ts'\nimport type { OperationSchema, Override, Refs } from './types.ts'\nimport { getSchemaFactory } from './utils/getSchemaFactory.ts'\nimport { getSchemas } from './utils/getSchemas.ts'\n\nexport type GetSchemaGeneratorOptions<T extends SchemaGenerator<any, any, any>> = T extends SchemaGenerator<infer Options, any, any> ? Options : never\n\nexport type SchemaMethodResult<TFileMeta extends FileMetaBase> = Promise<KubbFile.File<TFileMeta> | Array<KubbFile.File<TFileMeta>> | null>\n\ntype Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {\n oas: Oas\n pluginManager: PluginManager\n /**\n * Current plugin\n */\n plugin: Plugin<TPluginOptions>\n mode: KubbFile.Mode\n include?: Array<'schemas' | 'responses' | 'requestBodies'>\n override: Array<Override<TOptions>> | undefined\n contentType?: contentType\n output?: string\n}\n\nexport type SchemaGeneratorOptions = {\n dateType: false | 'string' | 'stringOffset' | 'stringLocal' | 'date'\n unknownType: 'any' | 'unknown' | 'void'\n emptySchemaType: 'any' | 'unknown' | 'void'\n enumType?: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal'\n enumSuffix?: string\n usedEnumNames?: Record<string, number>\n mapper?: Record<string, string>\n typed?: boolean\n transformers: {\n /**\n * Customize the names based on the type that is provided by the plugin.\n */\n name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string\n /**\n * Receive schema and name(propertName) and return FakerMeta array\n * TODO TODO add docs\n * @beta\n */\n schema?: (schemaProps: SchemaProps, defaultSchemas: Schema[]) => Schema[] | undefined\n }\n}\n\nexport type SchemaGeneratorBuildOptions = Omit<OperationSchema, 'name' | 'schema'>\n\ntype SchemaProps = {\n schemaObject?: SchemaObject\n name?: string\n parentName?: string\n}\n\nexport class SchemaGenerator<\n TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions,\n TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions,\n TFileMeta extends FileMetaBase = FileMetaBase,\n> extends BaseGenerator<TOptions, Context<TOptions, TPluginOptions>> {\n // Collect the types of all referenced schemas, so we can export them later\n refs: Refs = {}\n\n // Keep track of already used type aliases\n #usedAliasNames: Record<string, number> = {}\n\n /**\n * Creates a type node from a given schema.\n * Delegates to getBaseTypeFromSchema internally and\n * optionally adds a union with null.\n */\n parse(props: SchemaProps): Schema[] {\n const options = this.#getOptions(props)\n\n const defaultSchemas = this.#parseSchemaObject(props)\n const schemas = options.transformers?.schema?.(props, defaultSchemas) || defaultSchemas || []\n\n return uniqueWith(schemas, isDeepEqual)\n }\n\n deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): Array<SchemaKeywordMapper[T]> {\n return SchemaGenerator.deepSearch<T>(tree, keyword)\n }\n\n find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined {\n return SchemaGenerator.find<T>(tree, keyword)\n }\n\n static deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): Array<SchemaKeywordMapper[T]> {\n const foundItems: SchemaKeywordMapper[T][] = []\n\n tree?.forEach((schema) => {\n if (schema.keyword === keyword) {\n foundItems.push(schema as SchemaKeywordMapper[T])\n }\n\n if (isKeyword(schema, schemaKeywords.object)) {\n Object.values(schema.args?.properties || {}).forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>(entrySchema, keyword))\n })\n\n Object.values(schema.args?.additionalProperties || {}).forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (isKeyword(schema, schemaKeywords.array)) {\n schema.args.items.forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (isKeyword(schema, schemaKeywords.and)) {\n schema.args.forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (isKeyword(schema, schemaKeywords.tuple)) {\n schema.args.items.forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n\n if (isKeyword(schema, schemaKeywords.union)) {\n schema.args.forEach((entrySchema) => {\n foundItems.push(...SchemaGenerator.deepSearch<T>([entrySchema], keyword))\n })\n }\n })\n\n return foundItems\n }\n\n static findInObject<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined {\n let foundItem: SchemaKeywordMapper[T] | undefined\n\n tree?.forEach((schema) => {\n if (!foundItem && schema.keyword === keyword) {\n foundItem = schema as SchemaKeywordMapper[T]\n }\n\n if (isKeyword(schema, schemaKeywords.object)) {\n Object.values(schema.args?.properties || {}).forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>(entrySchema, keyword)\n }\n })\n\n Object.values(schema.args?.additionalProperties || {}).forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n })\n\n return foundItem\n }\n\n static find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined {\n let foundItem: SchemaKeywordMapper[T] | undefined\n\n tree?.forEach((schema) => {\n if (!foundItem && schema.keyword === keyword) {\n foundItem = schema as SchemaKeywordMapper[T]\n }\n\n if (isKeyword(schema, schemaKeywords.array)) {\n schema.args.items.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n\n if (isKeyword(schema, schemaKeywords.and)) {\n schema.args.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n\n if (isKeyword(schema, schemaKeywords.tuple)) {\n schema.args.items.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n\n if (isKeyword(schema, schemaKeywords.union)) {\n schema.args.forEach((entrySchema) => {\n if (!foundItem) {\n foundItem = SchemaGenerator.find<T>([entrySchema], keyword)\n }\n })\n }\n })\n\n return foundItem\n }\n\n #getUsedEnumNames(props: SchemaProps) {\n const options = this.#getOptions(props)\n\n return options.usedEnumNames || {}\n }\n\n #getOptions({ name }: SchemaProps): Partial<TOptions> {\n const { override = [] } = this.context\n\n return {\n ...this.options,\n ...(override.find(({ pattern, type }) => {\n if (name && type === 'schemaName') {\n return !!name.match(pattern)\n }\n\n return false\n })?.options || {}),\n }\n }\n\n #getUnknownType(props: SchemaProps) {\n const options = this.#getOptions(props)\n\n if (options.unknownType === 'any') {\n return schemaKeywords.any\n }\n if (options.unknownType === 'void') {\n return schemaKeywords.void\n }\n\n return schemaKeywords.unknown\n }\n\n #getEmptyType(props: SchemaProps) {\n const options = this.#getOptions(props)\n\n if (options.emptySchemaType === 'any') {\n return schemaKeywords.any\n }\n if (options.emptySchemaType === 'void') {\n return schemaKeywords.void\n }\n\n return schemaKeywords.unknown\n }\n\n /**\n * Recursively creates a type literal with the given props.\n */\n #parseProperties({ schemaObject, name }: SchemaProps): Schema[] {\n const properties = schemaObject?.properties || {}\n const additionalProperties = schemaObject?.additionalProperties\n const required = schemaObject?.required\n\n const propertiesSchemas = Object.keys(properties)\n .map((propertyName) => {\n const validationFunctions: Schema[] = []\n const propertySchema = properties[propertyName] as SchemaObject\n\n const isRequired = Array.isArray(required) ? required?.includes(propertyName) : !!required\n const nullable = propertySchema.nullable ?? propertySchema['x-nullable'] ?? false\n\n validationFunctions.push(...this.parse({ schemaObject: propertySchema, name: propertyName, parentName: name }))\n\n validationFunctions.push({\n keyword: schemaKeywords.name,\n args: propertyName,\n })\n\n if (!isRequired && nullable) {\n validationFunctions.push({ keyword: schemaKeywords.nullish })\n } else if (!isRequired) {\n validationFunctions.push({ keyword: schemaKeywords.optional })\n }\n\n return {\n [propertyName]: validationFunctions,\n }\n })\n .reduce((acc, curr) => ({ ...acc, ...curr }), {})\n let additionalPropertiesSchemas: Schema[] = []\n\n if (additionalProperties) {\n additionalPropertiesSchemas =\n additionalProperties === true || !Object.keys(additionalProperties).length\n ? [{ keyword: this.#getUnknownType({ schemaObject, name }) }]\n : this.parse({ schemaObject: additionalProperties as SchemaObject, parentName: name })\n }\n\n return [\n {\n keyword: schemaKeywords.object,\n args: {\n properties: propertiesSchemas,\n additionalProperties: additionalPropertiesSchemas,\n },\n },\n ]\n }\n\n /**\n * Create a type alias for the schema referenced by the given ReferenceObject\n */\n #getRefAlias(schemaObject: OpenAPIV3.ReferenceObject, name: string | undefined): Schema[] {\n const { $ref } = schemaObject\n const ref = this.refs[$ref]\n\n if (ref) {\n const dereferencedSchema = this.context.oas.dereferenceWithRef(schemaObject)\n // pass name to getRefAlias and use that to find in discriminator.mapping value\n\n if (dereferencedSchema && isDiscriminator(dereferencedSchema)) {\n const [key] = Object.entries(dereferencedSchema.discriminator.mapping || {}).find(([_key, value]) => value.replace(/.+\\//, '') === name) || []\n\n if (key) {\n return [\n {\n keyword: schemaKeywords.and,\n args: [\n {\n keyword: schemaKeywords.ref,\n args: { name: ref.propertyName, $ref, path: ref.path, isImportable: !!this.context.oas.get($ref) },\n },\n {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n [dereferencedSchema.discriminator.propertyName]: [\n {\n keyword: schemaKeywords.const,\n args: {\n name: key,\n format: 'string',\n value: key,\n },\n },\n ],\n },\n },\n },\n ],\n },\n ] as Schema[]\n }\n }\n\n return [\n {\n keyword: schemaKeywords.ref,\n args: { name: ref.propertyName, $ref, path: ref.path, isImportable: !!this.context.oas.get($ref) },\n },\n ]\n }\n\n const originalName = getUniqueName($ref.replace(/.+\\//, ''), this.#usedAliasNames)\n const propertyName = this.context.pluginManager.resolveName({\n name: originalName,\n pluginKey: this.context.plugin.key,\n type: 'function',\n })\n\n const fileName = this.context.pluginManager.resolveName({\n name: originalName,\n pluginKey: this.context.plugin.key,\n type: 'file',\n })\n const file = this.context.pluginManager.getFile({\n name: fileName,\n pluginKey: this.context.plugin.key,\n extname: '.ts',\n })\n\n this.refs[$ref] = {\n propertyName,\n originalName,\n path: file.path,\n }\n\n return this.#getRefAlias(schemaObject, name)\n }\n\n #getParsedSchemaObject(schema?: SchemaObject) {\n return getSchemaFactory(this.context.oas)(schema)\n }\n\n #addDiscriminatorToSchema<TSchema extends Schema>({\n schema,\n schemaObject,\n discriminator,\n }: {\n schemaObject: SchemaObject\n schema: TSchema\n discriminator: OpenAPIV3.DiscriminatorObject\n }): TSchema {\n if (!isKeyword(schema, schemaKeywords.union)) {\n return schema\n }\n\n const objectPropertySchema = SchemaGenerator.find(this.parse({ schemaObject: schemaObject }), schemaKeywords.object)\n\n return {\n ...schema,\n args: Object.entries(discriminator.mapping || {}).map(([key, value]) => {\n const arg = schema.args.find((item) => isKeyword(item, schemaKeywords.ref) && item.args.$ref === value)\n return {\n keyword: schemaKeywords.and,\n args: [\n arg,\n {\n keyword: schemaKeywords.object,\n args: {\n properties: {\n ...(objectPropertySchema?.args?.properties || {}),\n [discriminator.propertyName]: [\n {\n keyword: schemaKeywords.const,\n args: {\n name: key,\n format: 'string',\n value: key,\n },\n },\n //enum and literal will conflict\n ...(objectPropertySchema?.args?.properties[discriminator.propertyName] || []),\n ].filter((item) => !isKeyword(item, schemaKeywords.enum)),\n },\n },\n },\n ],\n }\n }),\n }\n }\n\n /**\n * This is the very core of the OpenAPI to TS conversion - it takes a\n * schema and returns the appropriate type.\n */\n #parseSchemaObject({ schemaObject: _schemaObject, name, parentName }: SchemaProps): Schema[] {\n const { schemaObject, version } = this.#getParsedSchemaObject(_schemaObject)\n\n const options = this.#getOptions({ schemaObject, name })\n const emptyType = this.#getEmptyType({ schemaObject, name })\n\n if (!schemaObject) {\n return [{ keyword: emptyType }]\n }\n\n const baseItems: Schema[] = [\n {\n keyword: schemaKeywords.schema,\n args: {\n type: schemaObject.type as any,\n format: schemaObject.format,\n },\n },\n ]\n const min = schemaObject.minimum ?? schemaObject.minLength ?? schemaObject.minItems ?? undefined\n const max = schemaObject.maximum ?? schemaObject.maxLength ?? schemaObject.maxItems ?? undefined\n const nullable = isNullable(schemaObject)\n const defaultNullAndNullable = schemaObject.default === null && nullable\n\n if (schemaObject.default !== undefined && !defaultNullAndNullable && !Array.isArray(schemaObject.default)) {\n if (typeof schemaObject.default === 'string') {\n baseItems.push({\n keyword: schemaKeywords.default,\n args: transformers.stringify(schemaObject.default),\n })\n } else if (typeof schemaObject.default === 'boolean') {\n baseItems.push({\n keyword: schemaKeywords.default,\n args: schemaObject.default ?? false,\n })\n } else {\n baseItems.push({\n keyword: schemaKeywords.default,\n args: schemaObject.default,\n })\n }\n }\n\n if (schemaObject.deprecated) {\n baseItems.push({\n keyword: schemaKeywords.deprecated,\n })\n }\n\n if (schemaObject.description) {\n baseItems.push({\n keyword: schemaKeywords.describe,\n args: schemaObject.description,\n })\n }\n\n if (max !== undefined) {\n baseItems.unshift({ keyword: schemaKeywords.max, args: max })\n }\n\n if (min !== undefined) {\n baseItems.unshift({ keyword: schemaKeywords.min, args: min })\n }\n\n if (nullable) {\n baseItems.push({ keyword: schemaKeywords.nullable })\n }\n\n if (schemaObject.type && Array.isArray(schemaObject.type)) {\n // OPENAPI v3.1.0: https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0\n const items = schemaObject.type.filter((value) => value !== 'null') as Array<OpenAPIV3.NonArraySchemaObjectType>\n const hasNull = (schemaObject.type as string[]).includes('null')\n\n if (hasNull && !nullable) {\n baseItems.push({ keyword: schemaKeywords.nullable })\n }\n\n if (items.length > 1) {\n const parsedItems = [\n {\n keyword: schemaKeywords.union,\n args: items\n .map(\n (item) =>\n this.parse({\n schemaObject: { ...schemaObject, type: item },\n name,\n parentName,\n })[0],\n )\n .filter(Boolean)\n .filter((item) => !isKeyword(item, schemaKeywords.unknown))\n .map((item) => (isKeyword(item, schemaKeywords.object) ? { ...item, args: { ...item.args, strict: true } } : item)),\n },\n ]\n\n return [...parsedItems, ...baseItems].filter(Boolean)\n }\n }\n\n if (schemaObject.readOnly) {\n baseItems.push({ keyword: schemaKeywords.readOnly })\n }\n\n if (schemaObject.writeOnly) {\n baseItems.push({ keyword: schemaKeywords.writeOnly })\n }\n\n if (isReference(schemaObject)) {\n return [\n ...this.#getRefAlias(schemaObject, name),\n schemaObject.description && {\n keyword: schemaKeywords.describe,\n args: schemaObject.description,\n },\n nullable && { keyword: schemaKeywords.nullable },\n schemaObject.readOnly && { keyword: schemaKeywords.readOnly },\n schemaObject.writeOnly && { keyword: schemaKeywords.writeOnly },\n {\n keyword: schemaKeywords.schema,\n args: {\n type: schemaObject.type as any,\n format: schemaObject.format,\n },\n },\n ].filter(Boolean)\n }\n\n if (schemaObject.oneOf || schemaObject.anyOf) {\n // union\n const schemaWithoutOneOf = { ...schemaObject, oneOf: undefined, anyOf: undefined }\n const discriminator = this.context.oas.getDiscriminator(schemaObject)\n\n const union: SchemaKeywordMapper['union'] = {\n keyword: schemaKeywords.union,\n args: (schemaObject.oneOf || schemaObject.anyOf)!\n .map((item) => {\n // first item, this will be ref\n return item && this.parse({ schemaObject: item as SchemaObject, name, parentName })[0]\n })\n .filter(Boolean)\n .filter((item) => !isKeyword(item, schemaKeywords.unknown)),\n }\n\n if (discriminator) {\n if (this.context) return [this.#addDiscriminatorToSchema({ schemaObject: schemaWithoutOneOf, schema: union, discriminator }), ...baseItems]\n }\n\n if (schemaWithoutOneOf.properties) {\n const propertySchemas = this.parse({ schemaObject: schemaWithoutOneOf, name, parentName })\n\n union.args = [\n ...union.args.map((arg) => {\n return {\n keyword: schemaKeywords.and,\n args: [arg, ...propertySchemas],\n }\n }),\n ]\n\n return [union, ...baseItems]\n }\n\n return [union, ...baseItems]\n }\n\n if (schemaObject.allOf) {\n // intersection/add\n const schemaWithoutAllOf = { ...schemaObject, allOf: undefined }\n\n const and: Schema = {\n keyword: schemaKeywords.and,\n args: schemaObject.allOf\n .map((item) => {\n return item && this.parse({ schemaObject: item as SchemaObject, name, parentName })[0]\n })\n .filter(Boolean)\n .filter((item) => !isKeyword(item, schemaKeywords.unknown)),\n }\n\n if (schemaWithoutAllOf.required) {\n // TODO use of Required ts helper instead\n const schemas = schemaObject.allOf\n .map((item) => {\n if (isReference(item)) {\n return this.context.oas.get(item.$ref) as SchemaObject\n }\n })\n .filter(Boolean)\n\n const items = schemaWithoutAllOf.required\n .filter((key) => {\n // filter out keys that are already part of the properties(reduce duplicated keys(https://github.com/kubb-labs/kubb/issues/1492)\n if (schemaWithoutAllOf.properties) {\n return !Object.keys(schemaWithoutAllOf.properties).includes(key)\n }\n\n // schema should include required fields when necessary https://github.com/kubb-labs/kubb/issues/1522\n return true\n })\n .map((key) => {\n const schema = schemas.find((item) => item.properties && Object.keys(item.properties).find((propertyKey) => propertyKey === key))\n\n if (schema?.properties?.[key]) {\n return {\n ...schema,\n properties: {\n [key]: schema.properties[key],\n },\n required: [key],\n }\n }\n })\n .filter(Boolean)\n\n and.args = [...(and.args || []), ...items.flatMap((item) => this.parse({ schemaObject: item as SchemaObject, name, parentName }))]\n }\n\n if (schemaWithoutAllOf.properties) {\n and.args = [...(and.args || []), ...this.parse({ schemaObject: schemaWithoutAllOf, name, parentName })]\n }\n\n return [and, ...baseItems]\n }\n\n if (schemaObject.enum) {\n if (options.enumSuffix === '') {\n this.context.pluginManager.logger.emit('info', 'EnumSuffix set to an empty string does not work')\n }\n\n const enumName = getUniqueName(pascalCase([parentName, name, options.enumSuffix].join(' ')), this.#getUsedEnumNames({ schemaObject, name }))\n const typeName = this.context.pluginManager.resolveName({\n name: enumName,\n pluginKey: this.context.plugin.key,\n type: 'type',\n })\n\n const nullableEnum = schemaObject.enum.includes(null)\n if (nullableEnum) {\n baseItems.push({ keyword: schemaKeywords.nullable })\n }\n const filteredValues = schemaObject.enum.filter((value) => value !== null)\n\n // x-enumNames has priority\n const extensionEnums = ['x-enumNames', 'x-enum-varnames']\n .filter((extensionKey) => extensionKey in schemaObject)\n .map((extensionKey) => {\n return [\n {\n keyword: schemaKeywords.enum,\n args: {\n name,\n typeName,\n asConst: false,\n items: [...new Set(schemaObject[extensionKey as keyof typeof schemaObject] as string[])].map((name: string | number, index) => ({\n name: transformers.stringify(name),\n value: schemaObject.enum?.[index] as string | number,\n format: isNumber(schemaObject.enum?.[index]) ? 'number' : 'string',\n })),\n },\n },\n ...baseItems.filter(\n (item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max && item.keyword !== schemaKeywords.matches,\n ),\n ]\n })\n\n if (schemaObject.type === 'number' || schemaObject.type === 'integer') {\n // we cannot use z.enum when enum type is number/integer\n const enumNames = extensionEnums[0]?.find((item) => isKeyword(item, schemaKeywords.enum)) as unknown as SchemaKeywordMapper['enum']\n return [\n {\n keyword: schemaKeywords.enum,\n args: {\n name: enumName,\n typeName,\n asConst: true,\n items: enumNames?.args?.items\n ? [...new Set(enumNames.args.items)].map(({ name, value }) => ({\n name,\n value,\n format: 'number',\n }))\n : [...new Set(filteredValues)].map((value: string) => {\n return {\n name: value,\n value,\n format: 'number',\n }\n }),\n },\n },\n ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max && item.keyword !== schemaKeywords.matches),\n ]\n }\n\n if (schemaObject.type === 'boolean') {\n // we cannot use z.enum when enum type is boolean\n const enumNames = extensionEnums[0]?.find((item) => isKeyword(item, schemaKeywords.enum)) as unknown as SchemaKeywordMapper['enum']\n return [\n {\n keyword: schemaKeywords.enum,\n args: {\n name: enumName,\n typeName,\n asConst: true,\n items: enumNames?.args?.items\n ? [...new Set(enumNames.args.items)].map(({ name, value }) => ({\n name,\n value,\n format: 'boolean',\n }))\n : [...new Set(filteredValues)].map((value: string) => {\n return {\n name: value,\n value,\n format: 'boolean',\n }\n }),\n },\n },\n ...baseItems.filter((item) => item.keyword !== schemaKeywords.matches),\n ]\n }\n\n if (extensionEnums.length > 0 && extensionEnums[0]) {\n return extensionEnums[0]\n }\n\n return [\n {\n keyword: schemaKeywords.enum,\n args: {\n name: enumName,\n typeName,\n asConst: false,\n items: [...new Set(filteredValues)].map((value: string) => ({\n name: transformers.stringify(value),\n value,\n format: isNumber(value) ? 'number' : 'string',\n })),\n },\n },\n ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max && item.keyword !== schemaKeywords.matches),\n ]\n }\n\n if ('prefixItems' in schemaObject) {\n const prefixItems = schemaObject.prefixItems as SchemaObject[]\n const items = 'items' in schemaObject ? (schemaObject.items as SchemaObject[]) : []\n const min = schemaObject.minimum ?? schemaObject.minLength ?? schemaObject.minItems ?? undefined\n const max = schemaObject.maximum ?? schemaObject.maxLength ?? schemaObject.maxItems ?? undefined\n\n return [\n {\n keyword: schemaKeywords.tuple,\n args: {\n min,\n max,\n items: prefixItems\n .map((item) => {\n return this.parse({ schemaObject: item, name, parentName })[0]\n })\n .filter(Boolean),\n rest: this.parse({\n schemaObject: items,\n name,\n parentName,\n })[0],\n },\n },\n ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max),\n ]\n }\n\n if (version === '3.1' && 'const' in schemaObject) {\n // const keyword takes precendence over the actual type.\n if (schemaObject['const']) {\n return [\n {\n keyword: schemaKeywords.const,\n args: {\n name: schemaObject['const'],\n format: typeof schemaObject['const'] === 'number' ? 'number' : 'string',\n value: schemaObject['const'],\n },\n },\n ...baseItems,\n ]\n }\n return [{ keyword: schemaKeywords.null }]\n }\n\n /**\n * > Structural validation alone may be insufficient to allow an application to correctly utilize certain values. The \"format\"\n * > annotation keyword is defined to allow schema authors to convey semantic information for a fixed subset of values which are\n * > accurately described by authoritative resources, be they RFCs or other external specifications.\n *\n * In other words: format is more specific than type alone, hence it should override the type value, if possible.\n *\n * see also https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00#rfc.section.7\n */\n if (schemaObject.format) {\n if (schemaObject.type === 'integer' && (schemaObject.format === 'int32' || schemaObject.format === 'int64')) {\n baseItems.unshift({ keyword: schemaKeywords.integer })\n return baseItems\n }\n\n if (schemaObject.type === 'number' && (schemaObject.format === 'float' || schemaObject.format === 'double')) {\n baseItems.unshift({ keyword: schemaKeywords.number })\n return baseItems\n }\n\n switch (schemaObject.format) {\n case 'binary':\n baseItems.push({ keyword: schemaKeywords.blob })\n return baseItems\n case 'date-time':\n if (options.dateType) {\n if (options.dateType === 'date') {\n baseItems.unshift({ keyword: schemaKeywords.date, args: { type: 'date' } })\n\n return baseItems\n }\n\n if (options.dateType === 'stringOffset') {\n baseItems.unshift({ keyword: schemaKeywords.datetime, args: { offset: true } })\n return baseItems\n }\n\n if (options.dateType === 'stringLocal') {\n baseItems.unshift({ keyword: schemaKeywords.datetime, args: { local: true } })\n return baseItems\n }\n\n baseItems.unshift({ keyword: schemaKeywords.datetime, args: { offset: false } })\n\n return baseItems\n }\n break\n case 'date':\n if (options.dateType) {\n if (options.dateType === 'date') {\n baseItems.unshift({ keyword: schemaKeywords.date, args: { type: 'date' } })\n\n return baseItems\n }\n\n baseItems.unshift({ keyword: schemaKeywords.date, args: { type: 'string' } })\n\n return baseItems\n }\n break\n case 'time':\n if (options.dateType) {\n if (options.dateType === 'date') {\n baseItems.unshift({ keyword: schemaKeywords.time, args: { type: 'date' } })\n\n return baseItems\n }\n\n baseItems.unshift({ keyword: schemaKeywords.time, args: { type: 'string' } })\n\n return baseItems\n }\n break\n case 'uuid':\n baseItems.unshift({ keyword: schemaKeywords.uuid })\n return baseItems\n case 'email':\n case 'idn-email':\n baseItems.unshift({ keyword: schemaKeywords.email })\n return baseItems\n case 'uri':\n case 'ipv4':\n case 'ipv6':\n case 'uri-reference':\n case 'hostname':\n case 'idn-hostname':\n baseItems.unshift({ keyword: schemaKeywords.url })\n return baseItems\n // case 'duration':\n // case 'json-pointer':\n // case 'relative-json-pointer':\n default:\n // formats not yet implemented: ignore.\n break\n }\n }\n\n if (schemaObject.pattern && schemaObject.type === 'string') {\n baseItems.unshift({\n keyword: schemaKeywords.matches,\n args: schemaObject.pattern,\n })\n\n return baseItems\n }\n\n // type based logic\n if ('items' in schemaObject || schemaObject.type === ('array' as 'string')) {\n const min = schemaObject.minimum ?? schemaObject.minLength ?? schemaObject.minItems ?? undefined\n const max = schemaObject.maximum ?? schemaObject.maxLength ?? schemaObject.maxItems ?? undefined\n const items = this.parse({ schemaObject: 'items' in schemaObject ? (schemaObject.items as SchemaObject) : [], name, parentName })\n const unique = !!schemaObject.uniqueItems\n\n return [\n {\n keyword: schemaKeywords.array,\n args: {\n items,\n min,\n max,\n unique,\n },\n },\n ...baseItems.filter((item) => item.keyword !== schemaKeywords.min && item.keyword !== schemaKeywords.max),\n ]\n }\n\n if (schemaObject.properties || schemaObject.additionalProperties) {\n if (isDiscriminator(schemaObject)) {\n // override schema to set type to be based on discriminator mapping, use of enum to convert type string to type 'mapping1' | 'mapping2'\n const schemaObjectOverriden = Object.keys(schemaObject.properties || {}).reduce((acc, propertyName) => {\n if (acc.properties?.[propertyName] && propertyName === schemaObject.discriminator.propertyName) {\n return {\n ...acc,\n properties: {\n ...acc.properties,\n [propertyName]: {\n ...((acc.properties[propertyName] as any) || {}),\n enum: schemaObject.discriminator.mapping ? Object.keys(schemaObject.discriminator.mapping) : undefined,\n },\n },\n }\n }\n\n return acc\n }, schemaObject || {}) as SchemaObject\n\n return [\n ...this.#parseProperties({\n schemaObject: schemaObjectOverriden,\n name,\n }),\n ...baseItems,\n ]\n }\n\n return [...this.#parseProperties({ schemaObject, name }), ...baseItems]\n }\n\n if (schemaObject.type) {\n const type = (\n Array.isArray(schemaObject.type) ? schemaObject.type.filter((item) => item !== 'null')[0] : schemaObject.type\n ) as OpenAPIV3.NonArraySchemaObjectType\n\n if (!['boolean', 'object', 'number', 'string', 'integer', 'null'].includes(type)) {\n this.context.pluginManager.logger.emit('warning', `Schema type '${schemaObject.type}' is not valid for schema ${parentName}.${name}`)\n }\n\n // 'string' | 'number' | 'integer' | 'boolean'\n return [{ keyword: type }, ...baseItems]\n }\n\n return [{ keyword: emptyType }]\n }\n\n async build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>> {\n const { oas, contentType, include } = this.context\n\n const schemas = getSchemas({ oas, contentType, includes: include })\n\n const promises = Object.entries(schemas).reduce((acc, [name, value]) => {\n if (!value) {\n return acc\n }\n\n const options = this.#getOptions({ name })\n const promiseOperation = this.schema.call(this, name, value, {\n ...this.options,\n ...options,\n })\n\n if (promiseOperation) {\n acc.push(promiseOperation)\n }\n\n generators?.forEach((generator) => {\n const tree = this.parse({ schemaObject: value, name: name })\n\n const promise = generator.schema?.({\n instance: this,\n schema: {\n name,\n value,\n tree,\n },\n options: {\n ...this.options,\n ...options,\n },\n } as any) as Promise<Array<KubbFile.File<TFileMeta>>>\n\n if (promise) {\n acc.push(promise)\n }\n })\n\n return acc\n }, [] as SchemaMethodResult<TFileMeta>[])\n\n const files = await Promise.all(promises)\n\n // using .flat because schemaGenerator[method] can return an array of files or just one file\n return files.flat().filter(Boolean)\n }\n\n /**\n * Schema\n */\n async schema(_name: string, _object: SchemaObject, _options: TOptions): SchemaMethodResult<TFileMeta> {\n return []\n }\n}\n"]}
|