swagger-typescript-api 13.3.0 → 13.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/cli.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const require_generate_templates = require('./generate-templates-BlSkwa8l.cjs');
2
+ const require_generate_templates = require('./generate-templates-CAvEodGO.cjs');
3
3
  const require_index = require('./index.cjs');
4
4
  let node_path = require("node:path");
5
5
  node_path = require_generate_templates.__toESM(node_path);
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { d as version, l as description, n as TemplatesGenConfig, o as CodeGenConfig, s as HTTP_CLIENT, t as generateTemplates, u as name } from "./generate-templates-BaT2BiRR.mjs";
2
+ import { d as version, l as description, n as TemplatesGenConfig, o as CodeGenConfig, s as HTTP_CLIENT, t as generateTemplates, u as name } from "./generate-templates-P84KxC-K.mjs";
3
3
  import { generateApi } from "./index.mjs";
4
4
  import * as path$1 from "node:path";
5
5
  import { loadConfig } from "c12";
@@ -227,7 +227,7 @@ var ComponentTypeNameResolver = class extends NameResolver {
227
227
  //#endregion
228
228
  //#region package.json
229
229
  var name = "swagger-typescript-api";
230
- var version = "13.3.0";
230
+ var version = "13.3.1";
231
231
  var description = "Generate the API client for Fetch or Axios from an OpenAPI Specification";
232
232
 
233
233
  //#endregion
@@ -995,7 +995,7 @@ var DiscriminatorSchemaParser = class extends MonoSchemaParser {
995
995
  const mappingUsageKey = mappingPropertySchemaEnumKeysMap[mappingKey] || ts.StringValue(mappingKey);
996
996
  if (ableToCreateMappingType) return ts.TypeWithGeneric(mappingTypeName, [mappingUsageKey, content]);
997
997
  return ts.ExpressionGroup(ts.IntersectionType([ts.ObjectWrapper(ts.TypeField({
998
- key: discriminator.propertyName,
998
+ key: ts.StringValue(discriminator.propertyName),
999
999
  value: mappingUsageKey
1000
1000
  })), content]));
1001
1001
  };
@@ -1293,7 +1293,12 @@ var PrimitiveSchemaParser = class extends MonoSchemaParser {
1293
1293
  }
1294
1294
  if (Array.isArray(type) && type.length) contentType = this.schemaParser._complexSchemaParsers.oneOf({
1295
1295
  ...typeof this.schema === "object" ? this.schema : {},
1296
- oneOf: type.map((type) => ({ type }))
1296
+ oneOf: type.map((t) => {
1297
+ const branch = { type: t };
1298
+ Object.assign(branch, this.schema);
1299
+ branch.type = t;
1300
+ return branch;
1301
+ })
1297
1302
  });
1298
1303
  if (Array.isArray(items) && type === SCHEMA_TYPES$1.ARRAY) contentType = this.config.Ts.Tuple(items.map((item) => this.schemaParserFabric.createSchemaParser({
1299
1304
  schema: item,
@@ -3562,4 +3567,4 @@ Object.defineProperty(exports, 'version', {
3562
3567
  return version;
3563
3568
  }
3564
3569
  });
3565
- //# sourceMappingURL=generate-templates-BlSkwa8l.cjs.map
3570
+ //# sourceMappingURL=generate-templates-CAvEodGO.cjs.map