swagger-typescript-api 13.11.1 → 13.12.0

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.
@@ -208,7 +208,7 @@ var ComponentTypeNameResolver = class extends NameResolver {
208
208
  //#endregion
209
209
  //#region package.json
210
210
  var name = "swagger-typescript-api";
211
- var version = "13.11.1";
211
+ var version = "13.12.0";
212
212
  var description = "Generate the API client for Fetch or Axios from an OpenAPI Specification";
213
213
  //#endregion
214
214
  //#region src/constants.ts
@@ -322,7 +322,7 @@ var CodeGenConfig = class {
322
322
  generateRouteTypes = false;
323
323
  /** CLI flag */
324
324
  generateClient = true;
325
- /** CLI flag. Controls enum output format: "enum" (default), "union" (T1 | T2 | TN), or "const" (as const object + type alias). */
325
+ /** CLI flag. Controls enum output format: "enum" (default), "union" (T1 | T2 | TN), "const" (as const object + type alias), or "const-enum" (const enum). */
326
326
  enumStyle = "enum";
327
327
  /** @deprecated Use enumStyle: "union" instead */
328
328
  generateUnionEnums = false;
@@ -1357,7 +1357,7 @@ var EnumSchemaParser = class extends MonoSchemaParser {
1357
1357
  schemaType: SCHEMA_TYPES$1.ENUM,
1358
1358
  type: SCHEMA_TYPES$1.ENUM,
1359
1359
  keyType,
1360
- typeIdentifier: this.config.enumStyle === "const" ? this.config.Ts.Keyword.Const : this.config.enumStyle === "union" ? this.config.Ts.Keyword.Type : this.config.Ts.Keyword.Enum,
1360
+ typeIdentifier: this.config.enumStyle === "const" ? this.config.Ts.Keyword.Const : this.config.enumStyle === "const-enum" ? `${this.config.Ts.Keyword.Const} ${this.config.Ts.Keyword.Enum}` : this.config.enumStyle === "union" ? this.config.Ts.Keyword.Type : this.config.Ts.Keyword.Enum,
1361
1361
  name: this.typeName,
1362
1362
  description: this.schemaFormatters.formatDescription(this.schema.description),
1363
1363
  content
@@ -3697,6 +3697,14 @@ var CodeGenProcess = class {
3697
3697
  return parsed;
3698
3698
  });
3699
3699
  this.schemaRoutes.attachSchema(resolvedSwaggerSchema, parsedSchemas);
3700
+ if (!this.config.preferExistingSchemaNamesForExternalRefs) {
3701
+ this.typeNameFormatter.precommit(this.schemaComponentsMap.getComponents().map((component) => component.typeName));
3702
+ for (const component of componentsToParse) {
3703
+ component.typeData = null;
3704
+ delete component.$prepared;
3705
+ component.typeData = this.schemaParserFabric.parseSchema(component.rawTypeData, component.typeName);
3706
+ }
3707
+ }
3700
3708
  const rawConfiguration = {
3701
3709
  apiConfig: this.createApiConfig(resolvedSwaggerSchema.usageSchema),
3702
3710
  config: this.config,
@@ -4162,4 +4170,4 @@ Object.defineProperty(exports, "version", {
4162
4170
  }
4163
4171
  });
4164
4172
 
4165
- //# sourceMappingURL=src-dL4yFLYT.cjs.map
4173
+ //# sourceMappingURL=src-t0Ockaa6.cjs.map