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 +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/{generate-templates-BlSkwa8l.cjs → generate-templates-CAvEodGO.cjs} +9 -4
- package/dist/generate-templates-CAvEodGO.cjs.map +1 -0
- package/dist/{generate-templates-BaT2BiRR.mjs → generate-templates-P84KxC-K.mjs} +9 -4
- package/dist/generate-templates-P84KxC-K.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +5 -5
- package/dist/generate-templates-BaT2BiRR.mjs.map +0 -1
- package/dist/generate-templates-BlSkwa8l.cjs.map +0 -1
|
@@ -179,7 +179,7 @@ var ComponentTypeNameResolver = class extends NameResolver {
|
|
|
179
179
|
//#endregion
|
|
180
180
|
//#region package.json
|
|
181
181
|
var name = "swagger-typescript-api";
|
|
182
|
-
var version = "13.3.
|
|
182
|
+
var version = "13.3.1";
|
|
183
183
|
var description = "Generate the API client for Fetch or Axios from an OpenAPI Specification";
|
|
184
184
|
|
|
185
185
|
//#endregion
|
|
@@ -947,7 +947,7 @@ var DiscriminatorSchemaParser = class extends MonoSchemaParser {
|
|
|
947
947
|
const mappingUsageKey = mappingPropertySchemaEnumKeysMap[mappingKey] || ts.StringValue(mappingKey);
|
|
948
948
|
if (ableToCreateMappingType) return ts.TypeWithGeneric(mappingTypeName, [mappingUsageKey, content]);
|
|
949
949
|
return ts.ExpressionGroup(ts.IntersectionType([ts.ObjectWrapper(ts.TypeField({
|
|
950
|
-
key: discriminator.propertyName,
|
|
950
|
+
key: ts.StringValue(discriminator.propertyName),
|
|
951
951
|
value: mappingUsageKey
|
|
952
952
|
})), content]));
|
|
953
953
|
};
|
|
@@ -1245,7 +1245,12 @@ var PrimitiveSchemaParser = class extends MonoSchemaParser {
|
|
|
1245
1245
|
}
|
|
1246
1246
|
if (Array.isArray(type) && type.length) contentType = this.schemaParser._complexSchemaParsers.oneOf({
|
|
1247
1247
|
...typeof this.schema === "object" ? this.schema : {},
|
|
1248
|
-
oneOf: type.map((
|
|
1248
|
+
oneOf: type.map((t) => {
|
|
1249
|
+
const branch = { type: t };
|
|
1250
|
+
Object.assign(branch, this.schema);
|
|
1251
|
+
branch.type = t;
|
|
1252
|
+
return branch;
|
|
1253
|
+
})
|
|
1249
1254
|
});
|
|
1250
1255
|
if (Array.isArray(items) && type === SCHEMA_TYPES$1.ARRAY) contentType = this.config.Ts.Tuple(items.map((item) => this.schemaParserFabric.createSchemaParser({
|
|
1251
1256
|
schema: item,
|
|
@@ -3443,4 +3448,4 @@ async function generateTemplates(config) {
|
|
|
3443
3448
|
|
|
3444
3449
|
//#endregion
|
|
3445
3450
|
export { CodeGenProcess as a, constants_exports as c, version as d, SCHEMA_TYPES as i, description as l, TemplatesGenConfig as n, CodeGenConfig as o, RequestContentKind as r, HTTP_CLIENT as s, generateTemplates as t, name as u };
|
|
3446
|
-
//# sourceMappingURL=generate-templates-
|
|
3451
|
+
//# sourceMappingURL=generate-templates-P84KxC-K.mjs.map
|