swagger-typescript-api 13.6.0 → 13.6.2

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.
@@ -213,7 +213,7 @@ var ComponentTypeNameResolver = class extends NameResolver {
213
213
  //#endregion
214
214
  //#region package.json
215
215
  var name = "swagger-typescript-api";
216
- var version = "13.6.0";
216
+ var version = "13.6.2";
217
217
  var description = "Generate the API client for Fetch or Axios from an OpenAPI Specification";
218
218
  //#endregion
219
219
  //#region src/constants.ts
@@ -1951,13 +1951,16 @@ var SchemaRoutes = class {
1951
1951
  return `headers: { ${Object.entries(headerTypes).map(([k, v]) => `"${k}": ${v}`).join(",")} },`;
1952
1952
  };
1953
1953
  const typesToCheck = (Array.isArray(originalProduces) && originalProduces.length > 0 ? originalProduces : null) ?? (produces?.length ? produces : null) ?? (successContentTypes?.length ? successContentTypes : null) ?? contentTypes;
1954
+ const isBinarySuccessType = this.isBinaryOnlyContentTypes(typesToCheck);
1954
1955
  return {
1955
1956
  contentTypes,
1956
1957
  responses: responseInfos,
1957
1958
  links,
1959
+ typesToCheck,
1958
1960
  success: {
1961
+ isBinary: isBinarySuccessType,
1959
1962
  schema: successResponse,
1960
- type: this.isBinaryOnlyContentTypes(typesToCheck) ? this.config.Ts.Keyword.Blob : successResponse?.type || this.config.Ts.Keyword.Any
1963
+ type: isBinarySuccessType ? this.config.Ts.Keyword.Blob : successResponse?.type || this.config.Ts.Keyword.Any
1961
1964
  },
1962
1965
  error: {
1963
1966
  schemas: errorResponses,
@@ -2797,7 +2800,8 @@ var SwaggerSchemaResolver = class {
2797
2800
  const originalProducesByRoute = Object.create(null);
2798
2801
  for (const [route, usagePathObject] of Object.entries(usagePaths)) {
2799
2802
  const routeWithoutBase = basePath && route.startsWith(basePath) ? route.slice(basePath.length) || "/" : route;
2800
- const originalPathObject = (0, es_toolkit_compat.get)(originalPaths, route) || (0, es_toolkit_compat.get)(originalPaths, routeWithoutBase.startsWith("/") ? routeWithoutBase : `/${routeWithoutBase}`) || {};
2803
+ const routeWithBase = basePath && !route.startsWith(basePath) ? `${basePath}${route.startsWith("/") ? route : `/${route}`}` : route;
2804
+ const originalPathObject = (0, es_toolkit_compat.get)(originalPaths, route) || (0, es_toolkit_compat.get)(originalPaths, routeWithoutBase.startsWith("/") ? routeWithoutBase : `/${routeWithoutBase}`) || (0, es_toolkit_compat.get)(originalPaths, routeWithBase) || {};
2801
2805
  for (const [methodName, usageRouteInfo] of Object.entries(usagePathObject)) {
2802
2806
  const originalRouteInfo = (0, es_toolkit_compat.get)(originalPathObject, methodName) || {};
2803
2807
  const usageRouteParams = (0, es_toolkit_compat.get)(usageRouteInfo, "parameters") || [];
@@ -3577,4 +3581,4 @@ Object.defineProperty(exports, "version", {
3577
3581
  }
3578
3582
  });
3579
3583
 
3580
- //# sourceMappingURL=src-BFo1mwTu.cjs.map
3584
+ //# sourceMappingURL=src-CxPRLeDh.cjs.map