@kubb/plugin-oas 4.2.2 → 4.3.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.
- package/dist/{OperationGenerator-BeVo1_b1.d.cts → OperationGenerator-XkW6FZJh.d.cts} +2 -2
- package/dist/{OperationGenerator-CUE372Ht.d.ts → OperationGenerator-ki8g970_.d.ts} +2 -2
- package/dist/{Schema-D-wz873C.d.cts → Schema-BXYfUkqN.d.cts} +3 -3
- package/dist/{Schema-BPvUCUWJ.d.ts → Schema-CHstINXC.d.ts} +3 -3
- package/dist/{SchemaGenerator-DYOXlswO.js → SchemaGenerator-B07tXh1b.js} +22 -4
- package/dist/SchemaGenerator-B07tXh1b.js.map +1 -0
- package/dist/{SchemaGenerator-BQUPa5AD.cjs → SchemaGenerator-DsK0wuii.cjs} +22 -4
- package/dist/SchemaGenerator-DsK0wuii.cjs.map +1 -0
- package/dist/{SchemaMapper-CqOUibvI.js → SchemaMapper-CM1eXksi.js} +3 -1
- package/dist/SchemaMapper-CM1eXksi.js.map +1 -0
- package/dist/{SchemaMapper-D8J0V9Pj.cjs → SchemaMapper-CpAbmGiH.cjs} +3 -1
- package/dist/SchemaMapper-CpAbmGiH.cjs.map +1 -0
- package/dist/{SchemaMapper-BvE5JflR.d.cts → SchemaMapper-MiRB5_Zp.d.cts} +11 -1
- package/dist/{SchemaMapper-BWDIvdP9.d.ts → SchemaMapper-qjB3rBph.d.ts} +11 -1
- package/dist/components.d.cts +3 -3
- package/dist/components.d.ts +3 -3
- package/dist/{generators-CJBwMPUb.js → generators-BUNmB1lx.js} +11 -8
- package/dist/generators-BUNmB1lx.js.map +1 -0
- package/dist/{generators-BIyNritE.cjs → generators-CoiXCnDY.cjs} +10 -7
- package/dist/generators-CoiXCnDY.cjs.map +1 -0
- package/dist/generators.cjs +1 -1
- package/dist/generators.d.cts +2 -2
- package/dist/generators.d.ts +2 -2
- package/dist/generators.js +1 -1
- package/dist/hooks.cjs +2 -2
- package/dist/hooks.d.cts +3 -3
- package/dist/hooks.d.ts +3 -3
- package/dist/hooks.js +2 -2
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/mocks.cjs +1 -1
- package/dist/mocks.d.cts +1 -1
- package/dist/mocks.d.ts +1 -1
- package/dist/mocks.js +1 -1
- package/dist/utils.d.cts +2 -2
- package/dist/utils.d.ts +2 -2
- package/package.json +6 -5
- package/src/SchemaGenerator.ts +18 -2
- package/src/SchemaMapper.ts +4 -0
- package/src/generator.tsx +11 -7
- package/dist/SchemaGenerator-BQUPa5AD.cjs.map +0 -1
- package/dist/SchemaGenerator-DYOXlswO.js.map +0 -1
- package/dist/SchemaMapper-CqOUibvI.js.map +0 -1
- package/dist/SchemaMapper-D8J0V9Pj.cjs.map +0 -1
- package/dist/generators-BIyNritE.cjs.map +0 -1
- package/dist/generators-CJBwMPUb.js.map +0 -1
package/dist/components.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { L as Operation$1, M as Oas$1, j as types_d_exports, t as OperationGenerator } from "./OperationGenerator-
|
|
2
|
-
import "./SchemaMapper-
|
|
3
|
-
import { t as Schema } from "./Schema-
|
|
1
|
+
import { L as Operation$1, M as Oas$1, j as types_d_exports, t as OperationGenerator } from "./OperationGenerator-XkW6FZJh.cjs";
|
|
2
|
+
import "./SchemaMapper-MiRB5_Zp.cjs";
|
|
3
|
+
import { t as Schema } from "./Schema-BXYfUkqN.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/components/Operation.d.ts
|
|
6
6
|
type Props$1 = {
|
package/dist/components.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { L as Operation$1, M as Oas$1, j as types_d_exports, t as OperationGenerator } from "./OperationGenerator-
|
|
2
|
-
import "./SchemaMapper-
|
|
3
|
-
import { t as Schema } from "./Schema-
|
|
1
|
+
import { L as Operation$1, M as Oas$1, j as types_d_exports, t as OperationGenerator } from "./OperationGenerator-ki8g970_.js";
|
|
2
|
+
import "./SchemaMapper-qjB3rBph.js";
|
|
3
|
+
import { t as Schema } from "./Schema-CHstINXC.js";
|
|
4
4
|
|
|
5
5
|
//#region src/components/Operation.d.ts
|
|
6
6
|
type Props$1 = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as Oas } from "./Oas-DoN76W2_.js";
|
|
2
2
|
import { n as getBanner, t as getFooter } from "./getFooter-CvTKkK7-.js";
|
|
3
3
|
import { camelCase } from "@kubb/core/transformers";
|
|
4
|
-
import { App, createApp } from "@kubb/react";
|
|
4
|
+
import { App, createApp, reactPlugin } from "@kubb/react";
|
|
5
5
|
import { jsx } from "@kubb/react/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/generator.tsx
|
|
@@ -41,8 +41,9 @@ function createReactGenerator(parseOptions) {
|
|
|
41
41
|
})
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
const app = createApp(
|
|
45
|
-
app.
|
|
44
|
+
const app = createApp();
|
|
45
|
+
app.use(reactPlugin);
|
|
46
|
+
app.render(Component);
|
|
46
47
|
return app.files;
|
|
47
48
|
},
|
|
48
49
|
async operation({ instance, operation, options }) {
|
|
@@ -74,8 +75,9 @@ function createReactGenerator(parseOptions) {
|
|
|
74
75
|
})
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
|
-
const app = createApp(
|
|
78
|
-
app.
|
|
78
|
+
const app = createApp();
|
|
79
|
+
app.use(reactPlugin);
|
|
80
|
+
app.render(Component);
|
|
79
81
|
return app.files;
|
|
80
82
|
},
|
|
81
83
|
async schema({ instance, schema, options }) {
|
|
@@ -107,8 +109,9 @@ function createReactGenerator(parseOptions) {
|
|
|
107
109
|
})
|
|
108
110
|
});
|
|
109
111
|
}
|
|
110
|
-
const app = createApp(
|
|
111
|
-
app.
|
|
112
|
+
const app = createApp();
|
|
113
|
+
app.use(reactPlugin);
|
|
114
|
+
app.render(Component);
|
|
112
115
|
return app.files;
|
|
113
116
|
}
|
|
114
117
|
};
|
|
@@ -148,4 +151,4 @@ const jsonGenerator = createGenerator({
|
|
|
148
151
|
|
|
149
152
|
//#endregion
|
|
150
153
|
export { createGenerator as n, createReactGenerator as r, jsonGenerator as t };
|
|
151
|
-
//# sourceMappingURL=generators-
|
|
154
|
+
//# sourceMappingURL=generators-BUNmB1lx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generators-BUNmB1lx.js","names":[],"sources":["../src/generator.tsx","../src/generators/jsonGenerator.ts"],"sourcesContent":["import type { PluginFactoryOptions } from '@kubb/core'\nimport type { KubbFile } from '@kubb/core/fs'\nimport type { Operation, SchemaObject } from '@kubb/oas'\nimport { App, createApp, reactPlugin } from '@kubb/react'\nimport type { KubbNode } from '@kubb/react/types'\nimport { Oas } from './components/Oas.tsx'\nimport type { OperationGenerator } from './OperationGenerator.ts'\nimport type { SchemaGenerator, SchemaGeneratorOptions } from './SchemaGenerator.ts'\nimport type { Schema } from './SchemaMapper.ts'\n\ntype OperationsProps<TOptions extends PluginFactoryOptions> = {\n instance: Omit<OperationGenerator<TOptions>, 'build'>\n options: TOptions['resolvedOptions']\n operations: Array<Operation>\n}\n\ntype OperationProps<TOptions extends PluginFactoryOptions> = {\n instance: Omit<OperationGenerator<TOptions>, 'build'>\n options: TOptions['resolvedOptions']\n operation: Operation\n}\n\ntype SchemaProps<TOptions extends PluginFactoryOptions> = {\n instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>\n options: TOptions['resolvedOptions']\n schema: {\n name: string\n tree: Array<Schema>\n value: SchemaObject\n }\n}\n\nexport type GeneratorOptions<TOptions extends PluginFactoryOptions> = {\n name: string\n operations?: (this: GeneratorOptions<TOptions>, props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>\n operation?: (this: GeneratorOptions<TOptions>, props: OperationProps<TOptions>) => Promise<KubbFile.File[]>\n schema?: (this: GeneratorOptions<TOptions>, props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>\n}\n\nexport type Generator<TOptions extends PluginFactoryOptions> = GeneratorOptions<TOptions>\n\nexport function createGenerator<TOptions extends PluginFactoryOptions>(parseOptions: GeneratorOptions<TOptions>): Generator<TOptions> {\n return parseOptions\n}\n\nexport type ReactGeneratorOptions<TOptions extends PluginFactoryOptions> = {\n name: string\n Operations?: (this: ReactGeneratorOptions<TOptions>, props: OperationsProps<TOptions>) => KubbNode\n Operation?: (this: ReactGeneratorOptions<TOptions>, props: OperationProps<TOptions>) => KubbNode\n Schema?: (this: ReactGeneratorOptions<TOptions>, props: SchemaProps<TOptions>) => KubbNode\n}\n\n/****\n * Creates a generator that uses React component functions to generate files for OpenAPI operations and schemas.\n *\n * The returned generator exposes async methods for generating files from operations, a single operation, or a schema, using the corresponding React components if provided. If a component is not defined, the method returns an empty array.\n *\n * @returns A generator object with async methods for operations, operation, and schema file generation.\n */\nexport function createReactGenerator<TOptions extends PluginFactoryOptions>(parseOptions: ReactGeneratorOptions<TOptions>): Generator<TOptions> {\n return {\n ...parseOptions,\n async operations({ instance, options, operations }) {\n if (!parseOptions.Operations) {\n return []\n }\n\n const { pluginManager, oas, plugin, mode } = instance.context\n const Operations = parseOptions.Operations\n\n function Component() {\n return (\n <App meta={{ pluginManager, plugin, mode }}>\n <Oas oas={oas} operations={operations} generator={instance}>\n <Operations operations={operations} instance={instance} options={options} />\n </Oas>\n </App>\n )\n }\n const app = createApp()\n app.use(reactPlugin)\n\n app.render(Component)\n return app.files\n },\n async operation({ instance, operation, options }) {\n if (!parseOptions.Operation) {\n return []\n }\n\n const { pluginManager, oas, plugin, mode } = instance.context\n const Operation = parseOptions.Operation\n\n function Component() {\n return (\n <App meta={{ pluginManager, plugin: { ...plugin, options }, mode }}>\n <Oas oas={oas} operations={[operation]} generator={instance}>\n <Oas.Operation operation={operation}>\n <Operation operation={operation} options={options} instance={instance} />\n </Oas.Operation>\n </Oas>\n </App>\n )\n }\n const app = createApp()\n app.use(reactPlugin)\n\n app.render(Component)\n\n return app.files\n },\n async schema({ instance, schema, options }) {\n if (!parseOptions.Schema) {\n return []\n }\n\n const { pluginManager, oas, plugin, mode } = instance.context\n\n const Schema = parseOptions.Schema\n\n function Component() {\n return (\n <App meta={{ pluginManager, plugin: { ...plugin, options }, mode }}>\n <Oas oas={oas}>\n <Oas.Schema name={schema.name} schemaObject={schema.value} tree={schema.tree}>\n <Schema schema={schema} options={options} instance={instance} />\n </Oas.Schema>\n </Oas>\n </App>\n )\n }\n const app = createApp()\n app.use(reactPlugin)\n\n app.render(Component)\n return app.files\n },\n }\n}\n","import { camelCase } from '@kubb/core/transformers'\nimport { createGenerator } from '../generator.tsx'\nimport type { PluginOas } from '../types.ts'\nimport { getBanner } from '../utils/getBanner.ts'\nimport { getFooter } from '../utils/getFooter.ts'\n\nexport const jsonGenerator = createGenerator<PluginOas>({\n name: 'plugin-oas',\n async schema({ schema, instance }) {\n const { pluginManager, plugin } = instance.context\n const file = pluginManager.getFile({\n name: camelCase(schema.name),\n extname: '.json',\n mode: 'split',\n pluginKey: plugin.key,\n })\n\n return [\n {\n ...file,\n sources: [\n {\n name: camelCase(schema.name),\n isExportable: false,\n isIndexable: false,\n value: JSON.stringify(schema.value),\n },\n ],\n banner: getBanner({\n oas: instance.context.oas,\n output: plugin.options.output,\n config: pluginManager.config,\n }),\n format: getFooter({ oas: instance.context.oas, output: plugin.options.output }),\n },\n ]\n },\n})\n"],"mappings":";;;;;;;AAyCA,SAAgB,gBAAuD,cAA+D;AACpI,QAAO;;;;;;;;;AAiBT,SAAgB,qBAA4D,cAAoE;AAC9I,QAAO;EACL,GAAG;EACH,MAAM,WAAW,EAAE,UAAU,SAAS,cAAc;AAClD,OAAI,CAAC,aAAa,WAChB,QAAO,EAAE;GAGX,MAAM,EAAE,eAAe,KAAK,QAAQ,SAAS,SAAS;GACtD,MAAM,aAAa,aAAa;GAEhC,SAAS,YAAY;AACnB,WACE,oBAAC;KAAI,MAAM;MAAE;MAAe;MAAQ;MAAM;eACxC,oBAAC;MAAS;MAAiB;MAAY,WAAW;gBAChD,oBAAC;OAAuB;OAAsB;OAAmB;QAAW;OACxE;MACF;;GAGV,MAAM,MAAM,WAAW;AACvB,OAAI,IAAI,YAAY;AAEpB,OAAI,OAAO,UAAU;AACrB,UAAO,IAAI;;EAEb,MAAM,UAAU,EAAE,UAAU,WAAW,WAAW;AAChD,OAAI,CAAC,aAAa,UAChB,QAAO,EAAE;GAGX,MAAM,EAAE,eAAe,KAAK,QAAQ,SAAS,SAAS;GACtD,MAAM,YAAY,aAAa;GAE/B,SAAS,YAAY;AACnB,WACE,oBAAC;KAAI,MAAM;MAAE;MAAe,QAAQ;OAAE,GAAG;OAAQ;OAAS;MAAE;MAAM;eAChE,oBAAC;MAAS;MAAK,YAAY,CAAC,UAAU;MAAE,WAAW;gBACjD,oBAAC,IAAI;OAAqB;iBACxB,oBAAC;QAAqB;QAAoB;QAAmB;SAAY;QAC3D;OACZ;MACF;;GAGV,MAAM,MAAM,WAAW;AACvB,OAAI,IAAI,YAAY;AAEpB,OAAI,OAAO,UAAU;AAErB,UAAO,IAAI;;EAEb,MAAM,OAAO,EAAE,UAAU,QAAQ,WAAW;AAC1C,OAAI,CAAC,aAAa,OAChB,QAAO,EAAE;GAGX,MAAM,EAAE,eAAe,KAAK,QAAQ,SAAS,SAAS;GAEtD,MAAM,SAAS,aAAa;GAE5B,SAAS,YAAY;AACnB,WACE,oBAAC;KAAI,MAAM;MAAE;MAAe,QAAQ;OAAE,GAAG;OAAQ;OAAS;MAAE;MAAM;eAChE,oBAAC;MAAS;gBACR,oBAAC,IAAI;OAAO,MAAM,OAAO;OAAM,cAAc,OAAO;OAAO,MAAM,OAAO;iBACtE,oBAAC;QAAe;QAAiB;QAAmB;SAAY;QACrD;OACT;MACF;;GAGV,MAAM,MAAM,WAAW;AACvB,OAAI,IAAI,YAAY;AAEpB,OAAI,OAAO,UAAU;AACrB,UAAO,IAAI;;EAEd;;;;;ACnIH,MAAa,gBAAgB,gBAA2B;CACtD,MAAM;CACN,MAAM,OAAO,EAAE,QAAQ,YAAY;EACjC,MAAM,EAAE,eAAe,WAAW,SAAS;AAQ3C,SAAO,CACL;GACE,GATS,cAAc,QAAQ;IACjC,MAAM,UAAU,OAAO,KAAK;IAC5B,SAAS;IACT,MAAM;IACN,WAAW,OAAO;IACnB,CAAC;GAKE,SAAS,CACP;IACE,MAAM,UAAU,OAAO,KAAK;IAC5B,cAAc;IACd,aAAa;IACb,OAAO,KAAK,UAAU,OAAO,MAAM;IACpC,CACF;GACD,QAAQ,UAAU;IAChB,KAAK,SAAS,QAAQ;IACtB,QAAQ,OAAO,QAAQ;IACvB,QAAQ,cAAc;IACvB,CAAC;GACF,QAAQ,UAAU;IAAE,KAAK,SAAS,QAAQ;IAAK,QAAQ,OAAO,QAAQ;IAAQ,CAAC;GAChF,CACF;;CAEJ,CAAC"}
|
|
@@ -45,8 +45,9 @@ function createReactGenerator(parseOptions) {
|
|
|
45
45
|
})
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
const app = (0, __kubb_react.createApp)(
|
|
49
|
-
app.
|
|
48
|
+
const app = (0, __kubb_react.createApp)();
|
|
49
|
+
app.use(__kubb_react.reactPlugin);
|
|
50
|
+
app.render(Component);
|
|
50
51
|
return app.files;
|
|
51
52
|
},
|
|
52
53
|
async operation({ instance, operation, options }) {
|
|
@@ -78,8 +79,9 @@ function createReactGenerator(parseOptions) {
|
|
|
78
79
|
})
|
|
79
80
|
});
|
|
80
81
|
}
|
|
81
|
-
const app = (0, __kubb_react.createApp)(
|
|
82
|
-
app.
|
|
82
|
+
const app = (0, __kubb_react.createApp)();
|
|
83
|
+
app.use(__kubb_react.reactPlugin);
|
|
84
|
+
app.render(Component);
|
|
83
85
|
return app.files;
|
|
84
86
|
},
|
|
85
87
|
async schema({ instance, schema, options }) {
|
|
@@ -111,8 +113,9 @@ function createReactGenerator(parseOptions) {
|
|
|
111
113
|
})
|
|
112
114
|
});
|
|
113
115
|
}
|
|
114
|
-
const app = (0, __kubb_react.createApp)(
|
|
115
|
-
app.
|
|
116
|
+
const app = (0, __kubb_react.createApp)();
|
|
117
|
+
app.use(__kubb_react.reactPlugin);
|
|
118
|
+
app.render(Component);
|
|
116
119
|
return app.files;
|
|
117
120
|
}
|
|
118
121
|
};
|
|
@@ -169,4 +172,4 @@ Object.defineProperty(exports, 'jsonGenerator', {
|
|
|
169
172
|
return jsonGenerator;
|
|
170
173
|
}
|
|
171
174
|
});
|
|
172
|
-
//# sourceMappingURL=generators-
|
|
175
|
+
//# sourceMappingURL=generators-CoiXCnDY.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generators-CoiXCnDY.cjs","names":["App","Oas","reactPlugin","getBanner","getFooter"],"sources":["../src/generator.tsx","../src/generators/jsonGenerator.ts"],"sourcesContent":["import type { PluginFactoryOptions } from '@kubb/core'\nimport type { KubbFile } from '@kubb/core/fs'\nimport type { Operation, SchemaObject } from '@kubb/oas'\nimport { App, createApp, reactPlugin } from '@kubb/react'\nimport type { KubbNode } from '@kubb/react/types'\nimport { Oas } from './components/Oas.tsx'\nimport type { OperationGenerator } from './OperationGenerator.ts'\nimport type { SchemaGenerator, SchemaGeneratorOptions } from './SchemaGenerator.ts'\nimport type { Schema } from './SchemaMapper.ts'\n\ntype OperationsProps<TOptions extends PluginFactoryOptions> = {\n instance: Omit<OperationGenerator<TOptions>, 'build'>\n options: TOptions['resolvedOptions']\n operations: Array<Operation>\n}\n\ntype OperationProps<TOptions extends PluginFactoryOptions> = {\n instance: Omit<OperationGenerator<TOptions>, 'build'>\n options: TOptions['resolvedOptions']\n operation: Operation\n}\n\ntype SchemaProps<TOptions extends PluginFactoryOptions> = {\n instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>\n options: TOptions['resolvedOptions']\n schema: {\n name: string\n tree: Array<Schema>\n value: SchemaObject\n }\n}\n\nexport type GeneratorOptions<TOptions extends PluginFactoryOptions> = {\n name: string\n operations?: (this: GeneratorOptions<TOptions>, props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>\n operation?: (this: GeneratorOptions<TOptions>, props: OperationProps<TOptions>) => Promise<KubbFile.File[]>\n schema?: (this: GeneratorOptions<TOptions>, props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>\n}\n\nexport type Generator<TOptions extends PluginFactoryOptions> = GeneratorOptions<TOptions>\n\nexport function createGenerator<TOptions extends PluginFactoryOptions>(parseOptions: GeneratorOptions<TOptions>): Generator<TOptions> {\n return parseOptions\n}\n\nexport type ReactGeneratorOptions<TOptions extends PluginFactoryOptions> = {\n name: string\n Operations?: (this: ReactGeneratorOptions<TOptions>, props: OperationsProps<TOptions>) => KubbNode\n Operation?: (this: ReactGeneratorOptions<TOptions>, props: OperationProps<TOptions>) => KubbNode\n Schema?: (this: ReactGeneratorOptions<TOptions>, props: SchemaProps<TOptions>) => KubbNode\n}\n\n/****\n * Creates a generator that uses React component functions to generate files for OpenAPI operations and schemas.\n *\n * The returned generator exposes async methods for generating files from operations, a single operation, or a schema, using the corresponding React components if provided. If a component is not defined, the method returns an empty array.\n *\n * @returns A generator object with async methods for operations, operation, and schema file generation.\n */\nexport function createReactGenerator<TOptions extends PluginFactoryOptions>(parseOptions: ReactGeneratorOptions<TOptions>): Generator<TOptions> {\n return {\n ...parseOptions,\n async operations({ instance, options, operations }) {\n if (!parseOptions.Operations) {\n return []\n }\n\n const { pluginManager, oas, plugin, mode } = instance.context\n const Operations = parseOptions.Operations\n\n function Component() {\n return (\n <App meta={{ pluginManager, plugin, mode }}>\n <Oas oas={oas} operations={operations} generator={instance}>\n <Operations operations={operations} instance={instance} options={options} />\n </Oas>\n </App>\n )\n }\n const app = createApp()\n app.use(reactPlugin)\n\n app.render(Component)\n return app.files\n },\n async operation({ instance, operation, options }) {\n if (!parseOptions.Operation) {\n return []\n }\n\n const { pluginManager, oas, plugin, mode } = instance.context\n const Operation = parseOptions.Operation\n\n function Component() {\n return (\n <App meta={{ pluginManager, plugin: { ...plugin, options }, mode }}>\n <Oas oas={oas} operations={[operation]} generator={instance}>\n <Oas.Operation operation={operation}>\n <Operation operation={operation} options={options} instance={instance} />\n </Oas.Operation>\n </Oas>\n </App>\n )\n }\n const app = createApp()\n app.use(reactPlugin)\n\n app.render(Component)\n\n return app.files\n },\n async schema({ instance, schema, options }) {\n if (!parseOptions.Schema) {\n return []\n }\n\n const { pluginManager, oas, plugin, mode } = instance.context\n\n const Schema = parseOptions.Schema\n\n function Component() {\n return (\n <App meta={{ pluginManager, plugin: { ...plugin, options }, mode }}>\n <Oas oas={oas}>\n <Oas.Schema name={schema.name} schemaObject={schema.value} tree={schema.tree}>\n <Schema schema={schema} options={options} instance={instance} />\n </Oas.Schema>\n </Oas>\n </App>\n )\n }\n const app = createApp()\n app.use(reactPlugin)\n\n app.render(Component)\n return app.files\n },\n }\n}\n","import { camelCase } from '@kubb/core/transformers'\nimport { createGenerator } from '../generator.tsx'\nimport type { PluginOas } from '../types.ts'\nimport { getBanner } from '../utils/getBanner.ts'\nimport { getFooter } from '../utils/getFooter.ts'\n\nexport const jsonGenerator = createGenerator<PluginOas>({\n name: 'plugin-oas',\n async schema({ schema, instance }) {\n const { pluginManager, plugin } = instance.context\n const file = pluginManager.getFile({\n name: camelCase(schema.name),\n extname: '.json',\n mode: 'split',\n pluginKey: plugin.key,\n })\n\n return [\n {\n ...file,\n sources: [\n {\n name: camelCase(schema.name),\n isExportable: false,\n isIndexable: false,\n value: JSON.stringify(schema.value),\n },\n ],\n banner: getBanner({\n oas: instance.context.oas,\n output: plugin.options.output,\n config: pluginManager.config,\n }),\n format: getFooter({ oas: instance.context.oas, output: plugin.options.output }),\n },\n ]\n },\n})\n"],"mappings":";;;;;;;;;;;AAyCA,SAAgB,gBAAuD,cAA+D;AACpI,QAAO;;;;;;;;;AAiBT,SAAgB,qBAA4D,cAAoE;AAC9I,QAAO;EACL,GAAG;EACH,MAAM,WAAW,EAAE,UAAU,SAAS,cAAc;AAClD,OAAI,CAAC,aAAa,WAChB,QAAO,EAAE;GAGX,MAAM,EAAE,eAAe,KAAK,QAAQ,SAAS,SAAS;GACtD,MAAM,aAAa,aAAa;GAEhC,SAAS,YAAY;AACnB,WACE,kDAACA;KAAI,MAAM;MAAE;MAAe;MAAQ;MAAM;eACxC,kDAACC;MAAS;MAAiB;MAAY,WAAW;gBAChD,kDAAC;OAAuB;OAAsB;OAAmB;QAAW;OACxE;MACF;;GAGV,MAAM,mCAAiB;AACvB,OAAI,IAAIC,yBAAY;AAEpB,OAAI,OAAO,UAAU;AACrB,UAAO,IAAI;;EAEb,MAAM,UAAU,EAAE,UAAU,WAAW,WAAW;AAChD,OAAI,CAAC,aAAa,UAChB,QAAO,EAAE;GAGX,MAAM,EAAE,eAAe,KAAK,QAAQ,SAAS,SAAS;GACtD,MAAM,YAAY,aAAa;GAE/B,SAAS,YAAY;AACnB,WACE,kDAACF;KAAI,MAAM;MAAE;MAAe,QAAQ;OAAE,GAAG;OAAQ;OAAS;MAAE;MAAM;eAChE,kDAACC;MAAS;MAAK,YAAY,CAAC,UAAU;MAAE,WAAW;gBACjD,kDAACA,gBAAI;OAAqB;iBACxB,kDAAC;QAAqB;QAAoB;QAAmB;SAAY;QAC3D;OACZ;MACF;;GAGV,MAAM,mCAAiB;AACvB,OAAI,IAAIC,yBAAY;AAEpB,OAAI,OAAO,UAAU;AAErB,UAAO,IAAI;;EAEb,MAAM,OAAO,EAAE,UAAU,QAAQ,WAAW;AAC1C,OAAI,CAAC,aAAa,OAChB,QAAO,EAAE;GAGX,MAAM,EAAE,eAAe,KAAK,QAAQ,SAAS,SAAS;GAEtD,MAAM,SAAS,aAAa;GAE5B,SAAS,YAAY;AACnB,WACE,kDAACF;KAAI,MAAM;MAAE;MAAe,QAAQ;OAAE,GAAG;OAAQ;OAAS;MAAE;MAAM;eAChE,kDAACC;MAAS;gBACR,kDAACA,gBAAI;OAAO,MAAM,OAAO;OAAM,cAAc,OAAO;OAAO,MAAM,OAAO;iBACtE,kDAAC;QAAe;QAAiB;QAAmB;SAAY;QACrD;OACT;MACF;;GAGV,MAAM,mCAAiB;AACvB,OAAI,IAAIC,yBAAY;AAEpB,OAAI,OAAO,UAAU;AACrB,UAAO,IAAI;;EAEd;;;;;ACnIH,MAAa,gBAAgB,gBAA2B;CACtD,MAAM;CACN,MAAM,OAAO,EAAE,QAAQ,YAAY;EACjC,MAAM,EAAE,eAAe,WAAW,SAAS;AAQ3C,SAAO,CACL;GACE,GATS,cAAc,QAAQ;IACjC,8CAAgB,OAAO,KAAK;IAC5B,SAAS;IACT,MAAM;IACN,WAAW,OAAO;IACnB,CAAC;GAKE,SAAS,CACP;IACE,8CAAgB,OAAO,KAAK;IAC5B,cAAc;IACd,aAAa;IACb,OAAO,KAAK,UAAU,OAAO,MAAM;IACpC,CACF;GACD,QAAQC,4BAAU;IAChB,KAAK,SAAS,QAAQ;IACtB,QAAQ,OAAO,QAAQ;IACvB,QAAQ,cAAc;IACvB,CAAC;GACF,QAAQC,4BAAU;IAAE,KAAK,SAAS,QAAQ;IAAK,QAAQ,OAAO,QAAQ;IAAQ,CAAC;GAChF,CACF;;CAEJ,CAAC"}
|
package/dist/generators.cjs
CHANGED
package/dist/generators.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as PluginOas, r as Generator } from "./OperationGenerator-
|
|
2
|
-
import "./SchemaMapper-
|
|
1
|
+
import { b as PluginOas, r as Generator } from "./OperationGenerator-XkW6FZJh.cjs";
|
|
2
|
+
import "./SchemaMapper-MiRB5_Zp.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/generators/jsonGenerator.d.ts
|
|
5
5
|
declare const jsonGenerator: Generator<PluginOas>;
|
package/dist/generators.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as PluginOas, r as Generator } from "./OperationGenerator-
|
|
2
|
-
import "./SchemaMapper-
|
|
1
|
+
import { b as PluginOas, r as Generator } from "./OperationGenerator-ki8g970_.js";
|
|
2
|
+
import "./SchemaMapper-qjB3rBph.js";
|
|
3
3
|
|
|
4
4
|
//#region src/generators/jsonGenerator.d.ts
|
|
5
5
|
declare const jsonGenerator: Generator<PluginOas>;
|
package/dist/generators.js
CHANGED
package/dist/hooks.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
const require_SchemaGenerator = require('./SchemaGenerator-
|
|
2
|
+
const require_SchemaGenerator = require('./SchemaGenerator-DsK0wuii.cjs');
|
|
3
3
|
const require_Oas = require('./Oas--cvTRMTA.cjs');
|
|
4
|
-
const require_SchemaMapper = require('./SchemaMapper-
|
|
4
|
+
const require_SchemaMapper = require('./SchemaMapper-CpAbmGiH.cjs');
|
|
5
5
|
require('./getSchemas-08CU8KWq.cjs');
|
|
6
6
|
let __kubb_react = require("@kubb/react");
|
|
7
7
|
__kubb_react = require_chunk.__toESM(__kubb_react);
|
package/dist/hooks.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { L as Operation, M as Oas, N as HttpMethod, O as Plugin, T as FileMetaBase, _ as OperationSchemas, k as ResolveNameParams } from "./OperationGenerator-
|
|
2
|
-
import { d as File, f as Import, p as Mode, t as Schema, u as Extname } from "./SchemaMapper-
|
|
3
|
-
import { n as SchemaContextProps } from "./Schema-
|
|
1
|
+
import { L as Operation, M as Oas, N as HttpMethod, O as Plugin, T as FileMetaBase, _ as OperationSchemas, k as ResolveNameParams } from "./OperationGenerator-XkW6FZJh.cjs";
|
|
2
|
+
import { d as File, f as Import, p as Mode, t as Schema, u as Extname } from "./SchemaMapper-MiRB5_Zp.cjs";
|
|
3
|
+
import { n as SchemaContextProps } from "./Schema-BXYfUkqN.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/hooks/useOas.d.ts
|
|
6
6
|
declare function useOas(): Oas;
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { L as Operation, M as Oas, N as HttpMethod, O as Plugin, T as FileMetaBase, _ as OperationSchemas, k as ResolveNameParams } from "./OperationGenerator-
|
|
2
|
-
import { d as File, f as Import, p as Mode, t as Schema, u as Extname } from "./SchemaMapper-
|
|
3
|
-
import { n as SchemaContextProps } from "./Schema-
|
|
1
|
+
import { L as Operation, M as Oas, N as HttpMethod, O as Plugin, T as FileMetaBase, _ as OperationSchemas, k as ResolveNameParams } from "./OperationGenerator-ki8g970_.js";
|
|
2
|
+
import { d as File, f as Import, p as Mode, t as Schema, u as Extname } from "./SchemaMapper-qjB3rBph.js";
|
|
3
|
+
import { n as SchemaContextProps } from "./Schema-CHstINXC.js";
|
|
4
4
|
|
|
5
5
|
//#region src/hooks/useOas.d.ts
|
|
6
6
|
declare function useOas(): Oas;
|
package/dist/hooks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as SchemaGenerator } from "./SchemaGenerator-
|
|
1
|
+
import { t as SchemaGenerator } from "./SchemaGenerator-B07tXh1b.js";
|
|
2
2
|
import { n as Schema, r as Operation, t as Oas } from "./Oas-DoN76W2_.js";
|
|
3
|
-
import { n as schemaKeywords } from "./SchemaMapper-
|
|
3
|
+
import { n as schemaKeywords } from "./SchemaMapper-CM1eXksi.js";
|
|
4
4
|
import "./getSchemas-CvUX0jWa.js";
|
|
5
5
|
import { useContext } from "@kubb/react";
|
|
6
6
|
import { usePlugin, usePluginManager } from "@kubb/core/hooks";
|
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
const require_SchemaGenerator = require('./SchemaGenerator-
|
|
2
|
+
const require_SchemaGenerator = require('./SchemaGenerator-DsK0wuii.cjs');
|
|
3
3
|
require('./Oas--cvTRMTA.cjs');
|
|
4
|
-
const require_generators = require('./generators-
|
|
4
|
+
const require_generators = require('./generators-CoiXCnDY.cjs');
|
|
5
5
|
require('./getFooter-pQXwqM81.cjs');
|
|
6
|
-
const require_SchemaMapper = require('./SchemaMapper-
|
|
6
|
+
const require_SchemaMapper = require('./SchemaMapper-CpAbmGiH.cjs');
|
|
7
7
|
require('./getSchemas-08CU8KWq.cjs');
|
|
8
8
|
const require_parseFromConfig = require('./parseFromConfig-o3tU1XJt.cjs');
|
|
9
9
|
let __kubb_core = require("@kubb/core");
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as UserPluginWithLifeCycle, C as ResolvePathOptions, S as Refs, _ as OperationSchemas, a as ReactGeneratorOptions, b as PluginOas, c as GetSchemaGeneratorOptions, d as SchemaGeneratorOptions, f as SchemaMethodResult, g as OperationSchema, h as Include, i as GeneratorOptions, l as SchemaGenerator, m as Exclude, n as OperationMethodResult, o as createGenerator, p as API, r as Generator, s as createReactGenerator, t as OperationGenerator, u as SchemaGeneratorBuildOptions, v as Options, w as Resolver, x as Ref, y as Override } from "./OperationGenerator-
|
|
2
|
-
import { a as SchemaMapper, c as schemaKeywords, i as SchemaKeywordMapper, n as SchemaKeyword, o as SchemaTree, r as SchemaKeywordBase, s as isKeyword, t as Schema } from "./SchemaMapper-
|
|
1
|
+
import { A as UserPluginWithLifeCycle, C as ResolvePathOptions, S as Refs, _ as OperationSchemas, a as ReactGeneratorOptions, b as PluginOas, c as GetSchemaGeneratorOptions, d as SchemaGeneratorOptions, f as SchemaMethodResult, g as OperationSchema, h as Include, i as GeneratorOptions, l as SchemaGenerator, m as Exclude, n as OperationMethodResult, o as createGenerator, p as API, r as Generator, s as createReactGenerator, t as OperationGenerator, u as SchemaGeneratorBuildOptions, v as Options, w as Resolver, x as Ref, y as Override } from "./OperationGenerator-XkW6FZJh.cjs";
|
|
2
|
+
import { a as SchemaMapper, c as schemaKeywords, i as SchemaKeywordMapper, n as SchemaKeyword, o as SchemaTree, r as SchemaKeywordBase, s as isKeyword, t as Schema } from "./SchemaMapper-MiRB5_Zp.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin.d.ts
|
|
5
5
|
declare const pluginOasName = "plugin-oas";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as UserPluginWithLifeCycle, C as ResolvePathOptions, S as Refs, _ as OperationSchemas, a as ReactGeneratorOptions, b as PluginOas, c as GetSchemaGeneratorOptions, d as SchemaGeneratorOptions, f as SchemaMethodResult, g as OperationSchema, h as Include, i as GeneratorOptions, l as SchemaGenerator, m as Exclude, n as OperationMethodResult, o as createGenerator, p as API, r as Generator, s as createReactGenerator, t as OperationGenerator, u as SchemaGeneratorBuildOptions, v as Options, w as Resolver, x as Ref, y as Override } from "./OperationGenerator-
|
|
2
|
-
import { a as SchemaMapper, c as schemaKeywords, i as SchemaKeywordMapper, n as SchemaKeyword, o as SchemaTree, r as SchemaKeywordBase, s as isKeyword, t as Schema } from "./SchemaMapper-
|
|
1
|
+
import { A as UserPluginWithLifeCycle, C as ResolvePathOptions, S as Refs, _ as OperationSchemas, a as ReactGeneratorOptions, b as PluginOas, c as GetSchemaGeneratorOptions, d as SchemaGeneratorOptions, f as SchemaMethodResult, g as OperationSchema, h as Include, i as GeneratorOptions, l as SchemaGenerator, m as Exclude, n as OperationMethodResult, o as createGenerator, p as API, r as Generator, s as createReactGenerator, t as OperationGenerator, u as SchemaGeneratorBuildOptions, v as Options, w as Resolver, x as Ref, y as Override } from "./OperationGenerator-ki8g970_.js";
|
|
2
|
+
import { a as SchemaMapper, c as schemaKeywords, i as SchemaKeywordMapper, n as SchemaKeyword, o as SchemaTree, r as SchemaKeywordBase, s as isKeyword, t as Schema } from "./SchemaMapper-qjB3rBph.js";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin.d.ts
|
|
5
5
|
declare const pluginOasName = "plugin-oas";
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as pLimit, t as SchemaGenerator } from "./SchemaGenerator-
|
|
1
|
+
import { n as pLimit, t as SchemaGenerator } from "./SchemaGenerator-B07tXh1b.js";
|
|
2
2
|
import "./Oas-DoN76W2_.js";
|
|
3
|
-
import { n as createGenerator, r as createReactGenerator, t as jsonGenerator } from "./generators-
|
|
3
|
+
import { n as createGenerator, r as createReactGenerator, t as jsonGenerator } from "./generators-BUNmB1lx.js";
|
|
4
4
|
import "./getFooter-CvTKkK7-.js";
|
|
5
|
-
import { n as schemaKeywords, t as isKeyword } from "./SchemaMapper-
|
|
5
|
+
import { n as schemaKeywords, t as isKeyword } from "./SchemaMapper-CM1eXksi.js";
|
|
6
6
|
import "./getSchemas-CvUX0jWa.js";
|
|
7
7
|
import { t as parseFromConfig } from "./parseFromConfig-DSI6Meg0.js";
|
|
8
8
|
import { BaseGenerator, createPlugin, getMode } from "@kubb/core";
|
package/dist/mocks.cjs
CHANGED
package/dist/mocks.d.cts
CHANGED
package/dist/mocks.d.ts
CHANGED
package/dist/mocks.js
CHANGED
package/dist/utils.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as Output, E as Config, F as OpenAPIV3$1, I as OpenAPIV3_1, L as Operation, M as Oas, P as OasTypes, R as SchemaObject$1, g as OperationSchema, j as types_d_exports, z as contentType } from "./OperationGenerator-
|
|
2
|
-
import "./SchemaMapper-
|
|
1
|
+
import { D as Output, E as Config, F as OpenAPIV3$1, I as OpenAPIV3_1, L as Operation, M as Oas, P as OasTypes, R as SchemaObject$1, g as OperationSchema, j as types_d_exports, z as contentType } from "./OperationGenerator-XkW6FZJh.cjs";
|
|
2
|
+
import "./SchemaMapper-MiRB5_Zp.cjs";
|
|
3
3
|
import { OASDocument, SchemaObject } from "oas/types";
|
|
4
4
|
import { OpenAPIV3 } from "openapi-types";
|
|
5
5
|
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as Output, E as Config, F as OpenAPIV3$1, I as OpenAPIV3_1, L as Operation, M as Oas, P as OasTypes, R as SchemaObject$1, g as OperationSchema, j as types_d_exports, z as contentType } from "./OperationGenerator-
|
|
2
|
-
import "./SchemaMapper-
|
|
1
|
+
import { D as Output, E as Config, F as OpenAPIV3$1, I as OpenAPIV3_1, L as Operation, M as Oas, P as OasTypes, R as SchemaObject$1, g as OperationSchema, j as types_d_exports, z as contentType } from "./OperationGenerator-ki8g970_.js";
|
|
2
|
+
import "./SchemaMapper-qjB3rBph.js";
|
|
3
3
|
import { OASDocument, SchemaObject } from "oas/types";
|
|
4
4
|
import { OpenAPIV3 } from "openapi-types";
|
|
5
5
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-oas",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.1",
|
|
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",
|
|
@@ -79,19 +79,20 @@
|
|
|
79
79
|
"!/**/__tests__/**"
|
|
80
80
|
],
|
|
81
81
|
"dependencies": {
|
|
82
|
+
"@kubb/react-fabric": "0.1.8",
|
|
82
83
|
"@stoplight/yaml": "^4.3.0",
|
|
83
84
|
"p-limit": "^7.2.0",
|
|
84
85
|
"remeda": "^2.32.0",
|
|
85
|
-
"@kubb/core": "4.
|
|
86
|
-
"@kubb/oas": "4.
|
|
87
|
-
"@kubb/react": "4.
|
|
86
|
+
"@kubb/core": "4.3.1",
|
|
87
|
+
"@kubb/oas": "4.3.1",
|
|
88
|
+
"@kubb/react": "4.3.1"
|
|
88
89
|
},
|
|
89
90
|
"devDependencies": {
|
|
90
91
|
"tsdown": "^0.15.9",
|
|
91
92
|
"typescript": "^5.9.3"
|
|
92
93
|
},
|
|
93
94
|
"peerDependencies": {
|
|
94
|
-
"@kubb/react": "^4.
|
|
95
|
+
"@kubb/react": "^4.3.0"
|
|
95
96
|
},
|
|
96
97
|
"engines": {
|
|
97
98
|
"node": ">=20"
|
package/src/SchemaGenerator.ts
CHANGED
|
@@ -518,6 +518,10 @@ export class SchemaGenerator<
|
|
|
518
518
|
]
|
|
519
519
|
const min = schemaObject.minimum ?? schemaObject.minLength ?? schemaObject.minItems ?? undefined
|
|
520
520
|
const max = schemaObject.maximum ?? schemaObject.maxLength ?? schemaObject.maxItems ?? undefined
|
|
521
|
+
|
|
522
|
+
const exclusiveMinimum = schemaObject.exclusiveMinimum
|
|
523
|
+
const exclusiveMaximum = schemaObject.exclusiveMaximum
|
|
524
|
+
|
|
521
525
|
const nullable = isNullable(schemaObject)
|
|
522
526
|
const defaultNullAndNullable = schemaObject.default === null && nullable
|
|
523
527
|
|
|
@@ -554,13 +558,25 @@ export class SchemaGenerator<
|
|
|
554
558
|
}
|
|
555
559
|
|
|
556
560
|
if (max !== undefined) {
|
|
557
|
-
|
|
561
|
+
if (exclusiveMaximum) {
|
|
562
|
+
baseItems.unshift({ keyword: schemaKeywords.exclusiveMaximum, args: max })
|
|
563
|
+
} else baseItems.unshift({ keyword: schemaKeywords.max, args: max })
|
|
558
564
|
}
|
|
559
565
|
|
|
560
566
|
if (min !== undefined) {
|
|
561
|
-
|
|
567
|
+
if (exclusiveMinimum) {
|
|
568
|
+
baseItems.unshift({ keyword: schemaKeywords.exclusiveMinimum, args: min })
|
|
569
|
+
} else baseItems.unshift({ keyword: schemaKeywords.min, args: min })
|
|
562
570
|
}
|
|
563
571
|
|
|
572
|
+
if (typeof exclusiveMaximum === 'number') {
|
|
573
|
+
//OPENAPI v3.1.0: https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0
|
|
574
|
+
baseItems.unshift({ keyword: schemaKeywords.exclusiveMaximum, args: exclusiveMaximum })
|
|
575
|
+
}
|
|
576
|
+
if (typeof exclusiveMinimum === 'number') {
|
|
577
|
+
//OPENAPI v3.1.0: https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0
|
|
578
|
+
baseItems.unshift({ keyword: schemaKeywords.exclusiveMinimum, args: exclusiveMinimum })
|
|
579
|
+
}
|
|
564
580
|
if (nullable) {
|
|
565
581
|
baseItems.push({ keyword: schemaKeywords.nullable })
|
|
566
582
|
}
|
package/src/SchemaMapper.ts
CHANGED
|
@@ -73,6 +73,8 @@ export type SchemaKeywordMapper = {
|
|
|
73
73
|
number: { keyword: 'number' }
|
|
74
74
|
max: { keyword: 'max'; args: number }
|
|
75
75
|
min: { keyword: 'min'; args: number }
|
|
76
|
+
exclusiveMaximum: { keyword: 'exclusiveMaximum'; args: number }
|
|
77
|
+
exclusiveMinimum: { keyword: 'exclusiveMinimum'; args: number }
|
|
76
78
|
describe: { keyword: 'describe'; args: string }
|
|
77
79
|
example: { keyword: 'example'; args: string }
|
|
78
80
|
deprecated: { keyword: 'deprecated' }
|
|
@@ -119,6 +121,8 @@ export const schemaKeywords = {
|
|
|
119
121
|
describe: 'describe',
|
|
120
122
|
min: 'min',
|
|
121
123
|
max: 'max',
|
|
124
|
+
exclusiveMinimum: 'exclusiveMinimum',
|
|
125
|
+
exclusiveMaximum: 'exclusiveMaximum',
|
|
122
126
|
optional: 'optional',
|
|
123
127
|
readOnly: 'readOnly',
|
|
124
128
|
writeOnly: 'writeOnly',
|
package/src/generator.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PluginFactoryOptions } from '@kubb/core'
|
|
2
2
|
import type { KubbFile } from '@kubb/core/fs'
|
|
3
3
|
import type { Operation, SchemaObject } from '@kubb/oas'
|
|
4
|
-
import { App, createApp } from '@kubb/react'
|
|
4
|
+
import { App, createApp, reactPlugin } from '@kubb/react'
|
|
5
5
|
import type { KubbNode } from '@kubb/react/types'
|
|
6
6
|
import { Oas } from './components/Oas.tsx'
|
|
7
7
|
import type { OperationGenerator } from './OperationGenerator.ts'
|
|
@@ -77,9 +77,10 @@ export function createReactGenerator<TOptions extends PluginFactoryOptions>(pars
|
|
|
77
77
|
</App>
|
|
78
78
|
)
|
|
79
79
|
}
|
|
80
|
-
const app = createApp(
|
|
80
|
+
const app = createApp()
|
|
81
|
+
app.use(reactPlugin)
|
|
81
82
|
|
|
82
|
-
app.render()
|
|
83
|
+
app.render(Component)
|
|
83
84
|
return app.files
|
|
84
85
|
},
|
|
85
86
|
async operation({ instance, operation, options }) {
|
|
@@ -101,9 +102,11 @@ export function createReactGenerator<TOptions extends PluginFactoryOptions>(pars
|
|
|
101
102
|
</App>
|
|
102
103
|
)
|
|
103
104
|
}
|
|
104
|
-
const app = createApp(
|
|
105
|
+
const app = createApp()
|
|
106
|
+
app.use(reactPlugin)
|
|
107
|
+
|
|
108
|
+
app.render(Component)
|
|
105
109
|
|
|
106
|
-
app.render()
|
|
107
110
|
return app.files
|
|
108
111
|
},
|
|
109
112
|
async schema({ instance, schema, options }) {
|
|
@@ -126,9 +129,10 @@ export function createReactGenerator<TOptions extends PluginFactoryOptions>(pars
|
|
|
126
129
|
</App>
|
|
127
130
|
)
|
|
128
131
|
}
|
|
129
|
-
const app = createApp(
|
|
132
|
+
const app = createApp()
|
|
133
|
+
app.use(reactPlugin)
|
|
130
134
|
|
|
131
|
-
app.render()
|
|
135
|
+
app.render(Component)
|
|
132
136
|
return app.files
|
|
133
137
|
},
|
|
134
138
|
}
|