swagger-typescript-api 13.2.5 → 13.2.7

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.
@@ -181,7 +181,7 @@ const getRandomInt = (min = 0, max = 1) => {
181
181
  var ComponentTypeNameResolver = class extends NameResolver {
182
182
  counter = 1;
183
183
  fallbackNameCounter = 1;
184
- countersByVariant = /* @__PURE__ */ new Map();
184
+ countersByVariant = new Map();
185
185
  constructor(config, reservedNames) {
186
186
  super(config, reservedNames, (variants) => {
187
187
  const randomVariant = variants[getRandomInt(0, variants.length - 1)];
@@ -203,7 +203,7 @@ var ComponentTypeNameResolver = class extends NameResolver {
203
203
  //#endregion
204
204
  //#region package.json
205
205
  var name = "swagger-typescript-api";
206
- var version = "13.2.5";
206
+ var version = "13.2.7";
207
207
  var description = "Generate the API client for Fetch or Axios from an OpenAPI Specification";
208
208
  var homepage = "https://github.com/acacode/swagger-typescript-api";
209
209
  var bugs = "https://github.com/acacode/swagger-typescript-api/issues";
@@ -265,11 +265,11 @@ var devDependencies = {
265
265
  "@tsconfig/strictest": "2.0.5",
266
266
  "@types/js-yaml": "4.0.9",
267
267
  "@types/lodash": "4.17.18",
268
- "@types/node": "24.0.3",
268
+ "@types/node": "24.0.4",
269
269
  "@types/swagger2openapi": "7.0.4",
270
270
  "axios": "1.10.0",
271
271
  "openapi-types": "12.1.3",
272
- "tsdown": "0.12.8",
272
+ "tsdown": "0.12.9",
273
273
  "typedoc": "0.28.5",
274
274
  "vitest": "3.2.4"
275
275
  };
@@ -452,7 +452,7 @@ var CodeGenConfig = class {
452
452
  httpClient: "http-client",
453
453
  outOfModuleApi: "Common"
454
454
  };
455
- routeNameDuplicatesMap = /* @__PURE__ */ new Map();
455
+ routeNameDuplicatesMap = new Map();
456
456
  hooks = {
457
457
  onPreBuildRoutePath: (_routePath) => void 0,
458
458
  onBuildRoutePath: (_routeData) => void 0,
@@ -1890,6 +1890,7 @@ var SchemaRoutes = class {
1890
1890
  ...refTypeInfo.rawTypeData,
1891
1891
  ...refTypeInfo.rawTypeData.schema || {}
1892
1892
  };
1893
+ if (parameter?.required && !routeParam.required) routeParam.required = parameter.required;
1893
1894
  } else {
1894
1895
  if (!parameter.in) return;
1895
1896
  if (!routeParams[parameter.in]) routeParams[parameter.in] = [];
@@ -2062,7 +2063,9 @@ var SchemaRoutes = class {
2062
2063
  if (schema?.typeData) schema.typeData.isExtractedRequestBody = true;
2063
2064
  content = this.schemaParserFabric.getInlineParseContent({ $ref: schema.$ref });
2064
2065
  }
2066
+ if (schema && schema.typeData && !schema.typeData.description && requestBody?.description) schema.typeData.description = requestBody.description;
2065
2067
  return {
2068
+ ...requestBody || {},
2066
2069
  paramName: requestBodyName || requestBody?.name || DEFAULT_BODY_ARG_NAME,
2067
2070
  contentTypes,
2068
2071
  contentKind,
@@ -2244,6 +2247,7 @@ var SchemaRoutes = class {
2244
2247
  type: queryType
2245
2248
  } : void 0,
2246
2249
  body: requestBodyInfo.type ? {
2250
+ ...requestBodyInfo,
2247
2251
  name: nameResolver.resolve([requestBodyInfo.paramName, ...RESERVED_BODY_ARG_NAMES]),
2248
2252
  optional: !requestBodyInfo.required,
2249
2253
  type: requestBodyInfo.type
@@ -2364,8 +2368,8 @@ var SchemaRoutes = class {
2364
2368
  var SchemaWalker = class {
2365
2369
  config;
2366
2370
  swaggerSchemaResolver;
2367
- schemas = /* @__PURE__ */ new Map();
2368
- caches = /* @__PURE__ */ new Map();
2371
+ schemas = new Map();
2372
+ caches = new Map();
2369
2373
  constructor(config, swaggerSchemaResolver) {
2370
2374
  this.config = config;
2371
2375
  this.swaggerSchemaResolver = swaggerSchemaResolver;
@@ -2654,7 +2658,7 @@ var JavascriptTranslator = class extends Translator {
2654
2658
  //#endregion
2655
2659
  //#region src/type-name-formatter.ts
2656
2660
  var TypeNameFormatter = class {
2657
- formattedModelNamesMap = /* @__PURE__ */ new Map();
2661
+ formattedModelNamesMap = new Map();
2658
2662
  config;
2659
2663
  constructor(config) {
2660
2664
  this.config = config;
@@ -3232,4 +3236,4 @@ Object.defineProperty(exports, 'package_default', {
3232
3236
  return package_default;
3233
3237
  }
3234
3238
  });
3235
- //# sourceMappingURL=src-B15eFEWm.cjs.map
3239
+ //# sourceMappingURL=src-DYNtMxii.cjs.map