@kubb/plugin-oas 3.0.0-alpha.8 → 3.0.0-alpha.9

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.
@@ -3155,12 +3155,12 @@ function isKeyword(meta, keyword) {
3155
3155
 
3156
3156
  // src/SchemaGenerator.ts
3157
3157
  init_esm_shims();
3158
- import { Generator } from "@kubb/core";
3158
+ import { BaseGenerator } from "@kubb/core";
3159
3159
  import transformers, { pascalCase } from "@kubb/core/transformers";
3160
3160
  import { getUniqueName } from "@kubb/core/utils";
3161
3161
  import { isReference } from "@kubb/oas";
3162
3162
  import { isDeepEqual, isNumber, uniqueWith } from "remeda";
3163
- var SchemaGenerator = class _SchemaGenerator extends Generator {
3163
+ var SchemaGenerator = class _SchemaGenerator extends BaseGenerator {
3164
3164
  // Collect the types of all referenced schemas, so we can export them later
3165
3165
  refs = {};
3166
3166
  // Keep track of already used type aliases
@@ -3404,11 +3404,6 @@ var SchemaGenerator = class _SchemaGenerator extends Generator {
3404
3404
  const options = this.#getOptions({ schema: _schema, name });
3405
3405
  const unknownReturn = this.#getUnknownReturn({ schema: _schema, name });
3406
3406
  const { schema, version } = this.#getParsedSchemaObject(_schema);
3407
- const resolvedName = this.context.pluginManager.resolveName({
3408
- name: `${parentName || ""} ${name}`,
3409
- pluginKey: this.context.plugin.key,
3410
- type: "type"
3411
- });
3412
3407
  if (!schema) {
3413
3408
  return [{ keyword: unknownReturn }];
3414
3409
  }
@@ -3430,12 +3425,16 @@ var SchemaGenerator = class _SchemaGenerator extends Generator {
3430
3425
  keyword: schemaKeywords.default,
3431
3426
  args: transformers.stringify(schema.default)
3432
3427
  });
3433
- }
3434
- if (typeof schema.default === "boolean") {
3428
+ } else if (typeof schema.default === "boolean") {
3435
3429
  baseItems.push({
3436
3430
  keyword: schemaKeywords.default,
3437
3431
  args: schema.default ?? false
3438
3432
  });
3433
+ } else {
3434
+ baseItems.push({
3435
+ keyword: schemaKeywords.default,
3436
+ args: schema.default
3437
+ });
3439
3438
  }
3440
3439
  }
3441
3440
  if (schema.description) {
@@ -3757,7 +3756,7 @@ var SchemaGenerator = class _SchemaGenerator extends Generator {
3757
3756
  }
3758
3757
  return [{ keyword: unknownReturn }];
3759
3758
  }
3760
- async build(...parsers) {
3759
+ async build(...generators) {
3761
3760
  const { oas, contentType, include } = this.context;
3762
3761
  const schemas = getSchemas({ oas, contentType, includes: include });
3763
3762
  const promises = Object.entries(schemas).reduce((acc, [name, schema]) => {
@@ -3769,8 +3768,8 @@ var SchemaGenerator = class _SchemaGenerator extends Generator {
3769
3768
  if (promiseOperation) {
3770
3769
  acc.push(promiseOperation);
3771
3770
  }
3772
- parsers?.forEach((parser) => {
3773
- const promise = parser.schema?.({
3771
+ generators?.forEach((generator) => {
3772
+ const promise = generator.schema?.({
3774
3773
  instance: this,
3775
3774
  name,
3776
3775
  schema,
@@ -3963,4 +3962,4 @@ react/cjs/react-jsx-runtime.development.js:
3963
3962
  * LICENSE file in the root directory of this source tree.
3964
3963
  *)
3965
3964
  */
3966
- //# sourceMappingURL=chunk-MUI5DWM3.js.map
3965
+ //# sourceMappingURL=chunk-M347763D.js.map