diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java index f188b31ab8e4..62ba265a4b2b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java @@ -144,6 +144,8 @@ public class CodegenModel implements IJsonSchemaValidationProperties { @Getter @Setter public List nonNullableVars = new ArrayList<>(); // a list of non-nullable properties @Getter @Setter + public List nameOnlyVars = new ArrayList<>(); // Names of properties specified by propertyNames + @Getter @Setter public Map allowableValues; // Sorted sets of required parameters. @@ -256,6 +258,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties { private Number multipleOf; private CodegenProperty items; private CodegenProperty additionalProperties; + private CodegenProperty propertyNames; private boolean isModel; private boolean hasRequiredVars; private boolean hasDiscriminatorWithNonEmptyMapping; @@ -634,6 +637,20 @@ public void setAdditionalProperties(CodegenProperty additionalProperties) { this.additionalProperties = additionalProperties; } + @Override + public CodegenProperty getPropertyNames() { + return propertyNames; + } + + @Override + public void setPropertyNames(CodegenProperty propertyNames) { + this.propertyNames = propertyNames; + if (!propertyNames.getIsEnum()) { + return; + } + this.nameOnlyVars.addAll(propertyNames.get_enum()); + } + @Override public boolean getHasValidation() { return hasValidation; @@ -970,6 +987,7 @@ public boolean equals(Object o) { Objects.equals(readOnlyVars, that.readOnlyVars) && Objects.equals(readWriteVars, that.readWriteVars) && Objects.equals(parentVars, that.parentVars) && + Objects.equals(nameOnlyVars, that.nameOnlyVars) && Objects.equals(allowableValues, that.allowableValues) && Objects.equals(mandatory, that.mandatory) && Objects.equals(allMandatory, that.allMandatory) && @@ -978,6 +996,7 @@ public boolean equals(Object o) { Objects.equals(vendorExtensions, that.vendorExtensions) && Objects.equals(additionalPropertiesType, that.additionalPropertiesType) && Objects.equals(isAdditionalPropertiesTrue, that.isAdditionalPropertiesTrue) && + Objects.equals(propertyNames, that.propertyNames) && Objects.equals(getMaxProperties(), that.getMaxProperties()) && Objects.equals(getMinProperties(), that.getMinProperties()) && Objects.equals(getMaxItems(), that.getMaxItems()) && @@ -1002,10 +1021,10 @@ public int hashCode() { getArrayModelType(), isAlias, isString, isInteger, isLong, isNumber, isNumeric, isFloat, isDouble, isDate, isDateTime, isNull, hasValidation, isShort, isUnboundedInteger, isBoolean, getVars(), getAllVars(), getNonNullableVars(), getRequiredVars(), getOptionalVars(), getReadOnlyVars(), getReadWriteVars(), - getParentVars(), getAllowableValues(), getMandatory(), getAllMandatory(), getImports(), hasVars, + getParentVars(), getNameOnlyVars(), getAllowableValues(), getMandatory(), getAllMandatory(), getImports(), hasVars, isEmptyVars(), hasMoreModels, hasEnums, isEnum, isNullable, hasRequired, hasOptional, isArray, hasChildren, isMap, isOptional, isDeprecated, hasReadOnly, hasOnlyReadOnly, getExternalDocumentation(), getVendorExtensions(), - getAdditionalPropertiesType(), getMaxProperties(), getMinProperties(), getUniqueItems(), getMaxItems(), + getAdditionalPropertiesType(), getPropertyNames(), getMaxProperties(), getMinProperties(), getUniqueItems(), getMaxItems(), getMinItems(), getMaxLength(), getMinLength(), getExclusiveMinimum(), getExclusiveMaximum(), getMinimum(), getMaximum(), getPattern(), getMultipleOf(), getItems(), getAdditionalProperties(), getIsModel(), getAdditionalPropertiesIsAnyType(), hasDiscriminatorWithNonEmptyMapping, diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java index 90c4c66558c0..1ffc353aa187 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java @@ -61,6 +61,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { public Map allowableValues; public CodegenProperty items; public CodegenProperty additionalProperties; + public CodegenProperty propertyNames; public List vars = new ArrayList(); // all properties (without parent's properties) public List requiredVars = new ArrayList(); public CodegenProperty mostInnerItems; @@ -193,6 +194,7 @@ public CodegenParameter copy() { output.minimum = this.minimum; output.pattern = this.pattern; output.additionalProperties = this.additionalProperties; + output.propertyNames = this.propertyNames; output.isNull = this.isNull; output.isVoid = this.isVoid; output.nameInPascalCase = this.nameInPascalCase; @@ -295,7 +297,7 @@ public int hashCode() { jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isPassword, isFreeFormObject, isAnyType, isArray, isMap, queryIsJsonMimeType, isOptional, isFile, isEnum, isEnumRef, _enum, allowableValues, - items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, + items, mostInnerItems, additionalProperties, propertyNames, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, isVoid, @@ -398,6 +400,7 @@ public boolean equals(Object o) { Objects.equals(allowableValues, that.allowableValues) && Objects.equals(items, that.items) && Objects.equals(additionalProperties, that.additionalProperties) && + Objects.equals(propertyNames, that.propertyNames) && Objects.equals(vars, that.vars) && Objects.equals(requiredVars, that.requiredVars) && Objects.equals(mostInnerItems, that.mostInnerItems) && @@ -495,6 +498,7 @@ public String toString() { sb.append(", items=").append(items); sb.append(", mostInnerItems=").append(mostInnerItems); sb.append(", additionalProperties=").append(additionalProperties); + sb.append(", propertyNames=").append(propertyNames); sb.append(", vars=").append(vars); sb.append(", requiredVars=").append(requiredVars); sb.append(", vendorExtensions=").append(vendorExtensions); @@ -858,6 +862,16 @@ public void setAdditionalProperties(CodegenProperty additionalProperties) { this.additionalProperties = additionalProperties; } + @Override + public CodegenProperty getPropertyNames() { + return propertyNames; + } + + @Override + public void setPropertyNames(CodegenProperty propertyNames) { + this.propertyNames = propertyNames; + } + @Override public List getVars() { return vars; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java index c854389be7b2..f73f2ce1e3ad 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java @@ -196,8 +196,10 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti // the undeclared properties. public CodegenProperty items; public CodegenProperty additionalProperties; + public CodegenProperty propertyNames; public List vars = new ArrayList(); // all properties (without parent's properties) public List requiredVars = new ArrayList<>(); + public List nameOnlyVars = new ArrayList<>(); public CodegenProperty mostInnerItems; @Getter @Setter public Map vendorExtensions = new HashMap(); @@ -465,6 +467,20 @@ public void setAdditionalProperties(CodegenProperty additionalProperties) { this.additionalProperties = additionalProperties; } + @Override + public CodegenProperty getPropertyNames() { + return propertyNames; + } + + @Override + public void setPropertyNames(CodegenProperty propertyNames) { + this.propertyNames = propertyNames; + if (!propertyNames.getIsEnum()) { + return; + } + nameOnlyVars.addAll(propertyNames.get_enum()); + } + @Override public boolean getIsModel() { return isModel; @@ -1190,6 +1206,7 @@ public boolean equals(Object o) { Objects.equals(allowableValues, that.allowableValues) && Objects.equals(items, that.items) && Objects.equals(additionalProperties, that.additionalProperties) && + Objects.equals(propertyNames, that.propertyNames) && Objects.equals(vars, that.vars) && Objects.equals(requiredVars, that.requiredVars) && Objects.equals(mostInnerItems, that.mostInnerItems) && @@ -1220,7 +1237,7 @@ public int hashCode() { isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isPassword, isFreeFormObject, isArray, isMap, isOptional, isEnum, isInnerEnum, isEnumRef, isAnyType, isReadOnly, isWriteOnly, isNullable, isShort, isUnboundedInteger, isSelfReference, isCircularReference, isDiscriminator, isNew, isOverridden, _enum, - allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, + allowableValues, items, mostInnerItems, additionalProperties, propertyNames, vars, requiredVars, vendorExtensions, hasValidation, isInherited, discriminatorValue, nameInPascalCase, nameInCamelCase, nameInSnakeCase, enumName, maxItems, minItems, isXmlAttribute, xmlPrefix, xmlName, xmlNamespace, isXmlWrapped, isNull, isVoid, additionalPropertiesIsAnyType, hasVars, hasRequired, diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java index 3298d80868f2..e3801103138d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java @@ -91,6 +91,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { public Number multipleOf; public CodegenProperty items; public CodegenProperty additionalProperties; + public CodegenProperty propertyNames; public List vars = new ArrayList(); // all properties (without parent's properties) public List requiredVars = new ArrayList(); private boolean hasValidation; @@ -113,7 +114,7 @@ public int hashCode() { isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBoolean, isDate, isDateTime, isUuid, isEmail, isPassword, isModel, isFreeFormObject, isAnyType, isDefault, simpleType, primitiveType, isMap, isOptional, isArray, isBinary, isFile, schema, jsonSchema, vendorExtensions, items, additionalProperties, - vars, requiredVars, isNull, isVoid, hasValidation, isShort, isUnboundedInteger, + propertyNames, vars, requiredVars, isNull, isVoid, hasValidation, isShort, isUnboundedInteger, getMaxProperties(), getMinProperties(), uniqueItems, getMaxItems(), getMinItems(), getMaxLength(), getMinLength(), exclusiveMinimum, exclusiveMaximum, getMinimum(), getMaximum(), getPattern(), is1xx, is2xx, is3xx, is4xx, is5xx, additionalPropertiesIsAnyType, hasVars, hasRequired, @@ -177,6 +178,7 @@ public boolean equals(Object o) { Objects.equals(content, that.getContent()) && Objects.equals(responseHeaders, that.getResponseHeaders()) && Objects.equals(composedSchemas, that.getComposedSchemas()) && + Objects.equals(propertyNames, that.propertyNames) && Objects.equals(vars, that.vars) && Objects.equals(requiredVars, that.requiredVars) && Objects.equals(headers, that.headers) && @@ -531,6 +533,16 @@ public void setAdditionalProperties(CodegenProperty additionalProperties) { this.additionalProperties = additionalProperties; } + @Override + public CodegenProperty getPropertyNames() { + return propertyNames; + } + + @Override + public void setPropertyNames(CodegenProperty propertyNames) { + this.propertyNames = propertyNames; + } + @Override public List getVars() { return vars; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 0695e32687e3..d6e79c14585f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -2895,6 +2895,7 @@ protected void updateModelForObject(CodegenModel m, Schema schema) { } // process 'additionalProperties' setAddProps(schema, m); + setPropNames(schema, m); addRequiredVarsMap(schema, m); } @@ -2916,6 +2917,7 @@ protected void updateModelForAnyType(CodegenModel m, Schema schema) { } // process 'additionalProperties' setAddProps(schema, m); + setPropNames(schema, m); addRequiredVarsMap(schema, m); } @@ -3232,6 +3234,18 @@ protected void SortModelPropertiesByRequiredFlag(CodegenModel model) { Collections.sort(model.allVars, comparator); } + protected void setPropNames(Schema schema, IJsonSchemaValidationProperties property) { + if (schema.equals(new Schema())) { + return; + } + + if (schema.getPropertyNames() == null) { + return; + } + CodegenProperty propNamesProp = fromProperty(getPropertyNamesName(), schema.getPropertyNames(), false, false); + property.setPropertyNames(propNamesProp); + } + protected void setAddProps(Schema schema, IJsonSchemaValidationProperties property) { if (schema.equals(new Schema())) { // if we are trying to set additionalProperties on an empty schema stop recursing @@ -3854,7 +3868,7 @@ protected void updatePropertyForObject(CodegenProperty property, Schema p) { // an object or anyType composed schema that has additionalProperties set updatePropertyForMap(property, p); } - addVarsRequiredVarsAdditionalProps(p, property); + addVarsRequiredVarsAdditionalPropsPropertyNames(p, property); } protected void updatePropertyForAnyType(CodegenProperty property, Schema p) { @@ -3877,7 +3891,7 @@ protected void updatePropertyForAnyType(CodegenProperty property, Schema p) { // even though it should allow in any type and have map constraints for properties updatePropertyForMap(property, p); } - addVarsRequiredVarsAdditionalProps(p, property); + addVarsRequiredVarsAdditionalPropsPropertyNames(p, property); } protected void updatePropertyForString(CodegenProperty property, Schema p) { @@ -5165,9 +5179,9 @@ public CodegenResponse fromResponse(String responseCode, ApiResponse response) { r.simpleType = false; r.containerType = cp.containerType; r.containerTypeMapped = cp.containerTypeMapped; - addVarsRequiredVarsAdditionalProps(responseSchema, r); + addVarsRequiredVarsAdditionalPropsPropertyNames(responseSchema, r); } else if (ModelUtils.isAnyType(responseSchema)) { - addVarsRequiredVarsAdditionalProps(responseSchema, r); + addVarsRequiredVarsAdditionalPropsPropertyNames(responseSchema, r); } else if (!ModelUtils.isBooleanSchema(responseSchema)) { // referenced schemas LOGGER.debug("Property type is not primitive: {}", cp.dataType); @@ -5478,14 +5492,14 @@ public CodegenParameter fromParameter(Parameter parameter, Set imports) if (ModelUtils.isFreeFormObject(parameterSchema, openAPI)) { codegenParameter.isFreeFormObject = true; } - addVarsRequiredVarsAdditionalProps(parameterSchema, codegenParameter); + addVarsRequiredVarsAdditionalPropsPropertyNames(parameterSchema, codegenParameter); } else if (ModelUtils.isNullType(parameterSchema)) { } else if (ModelUtils.isAnyType(parameterSchema)) { // any schema with no type set, composed schemas often do this if (ModelUtils.isMapSchema(parameterSchema)) { // for map parameter updateParameterForMap(codegenParameter, parameterSchema, imports); } - addVarsRequiredVarsAdditionalProps(parameterSchema, codegenParameter); + addVarsRequiredVarsAdditionalPropsPropertyNames(parameterSchema, codegenParameter); } else if (ModelUtils.isArraySchema(parameterSchema)) { Schema inner = ModelUtils.getSchemaItems(parameterSchema); @@ -7771,7 +7785,7 @@ protected void updateRequestBodyForObject(CodegenParameter codegenParameter, Sch // object type schema or composed schema with properties defined this.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, false); } - addVarsRequiredVarsAdditionalProps(schema, codegenParameter); + addVarsRequiredVarsAdditionalPropsPropertyNames(schema, codegenParameter); } protected void updateRequestBodyForArray(CodegenParameter codegenParameter, Schema schema, String name, Set imports, String bodyParameterName) { @@ -8056,7 +8070,7 @@ public CodegenParameter fromRequestBody(RequestBody body, Set imports, S } else { updateRequestBodyForPrimitiveType(codegenParameter, schema, bodyParameterName, imports); } - addVarsRequiredVarsAdditionalProps(schema, codegenParameter); + addVarsRequiredVarsAdditionalPropsPropertyNames(schema, codegenParameter); } else { // referenced schemas updateRequestBodyForPrimitiveType(codegenParameter, schema, bodyParameterName, imports); @@ -8174,12 +8188,13 @@ protected void addRequiredVarsMap(Schema schema, IJsonSchemaValidationProperties } } - protected void addVarsRequiredVarsAdditionalProps(Schema schema, IJsonSchemaValidationProperties property) { + protected void addVarsRequiredVarsAdditionalPropsPropertyNames(Schema schema, IJsonSchemaValidationProperties property) { setAddProps(schema, property); Set mandatory = schema.getRequired() == null ? Collections.emptySet() : new TreeSet<>(schema.getRequired()); addVars(property, property.getVars(), schema.getProperties(), mandatory); addRequiredVarsMap(schema, property); + setPropNames(schema, property); } protected String getItemsName(Schema containingSchema, String containingSchemaName) { @@ -8194,6 +8209,10 @@ protected String getAdditionalPropertiesName() { return "additional_properties"; } + protected String getPropertyNamesName() { + return "property_names"; + } + private void addJsonSchemaForBodyRequestInCaseItsNotPresent(CodegenParameter codegenParameter, RequestBody body) { if (codegenParameter.jsonSchema == null) codegenParameter.jsonSchema = Json.pretty(body); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java index 2666c1a81f47..2ef89868e815 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java @@ -136,6 +136,10 @@ public interface IJsonSchemaValidationProperties { void setAdditionalProperties(CodegenProperty additionalProperties); + CodegenProperty getPropertyNames(); + + void setPropertyNames(CodegenProperty propertyNames); + List getVars(); void setVars(List vars); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java index 777fed9b2cb4..3afb9831b022 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java @@ -282,6 +282,9 @@ private boolean isModelNeeded(Schema schema, Set visitedSchemas) { return true; } } + if (ModelUtils.hasEnumPropertyNames(schema)) { + return true; + } return false; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index 69a5a6240a22..65012d9f548b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -662,7 +662,7 @@ public String getTypeDeclaration(Schema p) { if (Boolean.TRUE.equals(inner.getNullable())) { nullSafeSuffix += " | null"; } - return "{ [key: string]: " + getTypeDeclaration(unaliasSchema(inner)) + nullSafeSuffix + "; }"; + return "Record"; } else if (ModelUtils.isFileSchema(p)) { return "File"; } else if (ModelUtils.isBinarySchema(p)) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java index a8f62b1b8331..8022b9dc07a7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java @@ -889,7 +889,7 @@ public static boolean isFreeFormObject(Schema schema, OpenAPI openAPI) { if (schema.getAdditionalProperties() instanceof Boolean && (Boolean) schema.getAdditionalProperties()) { return true; } else if (schema.getAdditionalProperties() instanceof JsonSchema) { - return true; + return !ModelUtils.hasEnumPropertyNames(schema); } else if (schema.getTypes() != null) { if (schema.getTypes().size() == 1) { // types = [object] return SchemaTypeUtil.OBJECT_TYPE.equals(schema.getTypes().iterator().next()); @@ -937,7 +937,7 @@ public static boolean isFreeFormObject(Schema schema, OpenAPI openAPI) { return objSchema.getProperties() == null || objSchema.getProperties().isEmpty(); } else if (addlProps instanceof Schema) { // additionalProperties defined as {} - return addlProps.getType() == null && addlProps.get$ref() == null && (addlProps.getProperties() == null || addlProps.getProperties().isEmpty()); + return addlProps.getType() == null && addlProps.get$ref() == null && (addlProps.getProperties() == null || addlProps.getProperties().isEmpty()) && !ModelUtils.hasEnumPropertyNames(schema); } } } @@ -963,7 +963,7 @@ public static boolean shouldGenerateMapModel(Schema schema) { // A composed schema (allOf, oneOf, anyOf) is considered a Map schema if the additionalproperties attribute is set // for that composed schema. However, in the case of a composed schema, the properties are defined or referenced // in the inner schemas, and the outer schema does not have properties. - return ModelUtils.isGenerateAliasAsModel(schema) || ModelUtils.isComposedSchema(schema) || !(schema.getProperties() == null || schema.getProperties().isEmpty()); + return ModelUtils.isGenerateAliasAsModel(schema) || ModelUtils.isComposedSchema(schema) || !(schema.getProperties() == null || schema.getProperties().isEmpty()) || ModelUtils.hasEnumPropertyNames(schema); } public static boolean shouldGenerateArrayModel(Schema schema) { @@ -2158,6 +2158,13 @@ public static boolean hasAnyOf(Schema schema) { return false; } + public static boolean hasEnumPropertyNames(Schema schema) { + if (schema == null || schema.getPropertyNames() == null) { + return false; + } + return !schema.getPropertyNames().getEnum().isEmpty(); + } + /** * Returns schema type. * For 3.1 spec, return the first one. diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/modelGenericAdditionalProperties.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/modelGenericAdditionalProperties.mustache index e6499ce9d63f..e5a2e4c7050b 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/modelGenericAdditionalProperties.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/modelGenericAdditionalProperties.mustache @@ -1,5 +1,8 @@ {{#additionalPropertiesType}} - [key: string]: {{{additionalPropertiesType}}}{{#hasVars}} | any{{/hasVars}}; + [key: string]: {{additionalPropertiesType}}{{#hasVars}} | any{{/hasVars}}; + {{#nameOnlyVars}} + {{.}}?: {{additionalPropertiesType}}; + {{/nameOnlyVars}} {{/additionalPropertiesType}} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java index 1608fe2750cf..e617b659c252 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java @@ -187,10 +187,10 @@ public void getTypeDeclarationTest() { parentSchema = new MapSchema().additionalProperties(new Schema().$ref("#/components/schemas/Child")); ModelUtils.setGenerateAliasAsModel(false); - Assert.assertEquals(codegen.getTypeDeclaration(parentSchema), "{ [key: string]: Array; }"); + Assert.assertEquals(codegen.getTypeDeclaration(parentSchema), "Record>"); ModelUtils.setGenerateAliasAsModel(true); - Assert.assertEquals(codegen.getTypeDeclaration(parentSchema), "{ [key: string]: Child; }"); + Assert.assertEquals(codegen.getTypeDeclaration(parentSchema), "Record"); } @Test diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java index 1795a90ef938..e0d722096645 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java @@ -443,7 +443,7 @@ public void testNullSafeAdditionalProps() { codegen.additionalProperties().put("nullSafeAdditionalProps", true); codegen.processOpts(); - Assert.assertEquals(codegen.getTypeDeclaration(model), "{ [key: string]: string | undefined; }"); + Assert.assertEquals(codegen.getTypeDeclaration(model), "Record"); } @Test(description = "Don't add null safe additional property indexer by default") @@ -453,7 +453,7 @@ public void testWithoutNullSafeAdditionalProps() { final DefaultCodegen codegen = new TypeScriptFetchClientCodegen(); codegen.processOpts(); - Assert.assertEquals(codegen.getTypeDeclaration(model), "{ [key: string]: string; }"); + Assert.assertEquals(codegen.getTypeDeclaration(model), "Record"); } @Test(description = "Don't generate new schemas for readonly references") diff --git a/samples/client/others/typescript-node/encode-decode/build/api/defaultApi.ts b/samples/client/others/typescript-node/encode-decode/build/api/defaultApi.ts index ff6d6f883880..63f58174e475 100644 --- a/samples/client/others/typescript-node/encode-decode/build/api/defaultApi.ts +++ b/samples/client/others/typescript-node/encode-decode/build/api/defaultApi.ts @@ -212,7 +212,7 @@ export class DefaultApi { /** * */ - public async testDecodeArrayOfMapsOfObjectsGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<{ [key: string]: ComplexObject | undefined; }>; }> { + public async testDecodeArrayOfMapsOfObjectsGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array>; }> { const localVarPath = this.basePath + '/test/decode/array-of/maps-of/objects'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); @@ -254,13 +254,13 @@ export class DefaultApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: Array<{ [key: string]: ComplexObject | undefined; }>; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: Array>; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "Array<{ [key: string]: ComplexObject | undefined; }>"); + body = ObjectSerializer.deserialize(body, "Array>"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); @@ -456,7 +456,7 @@ export class DefaultApi { /** * */ - public async testDecodeMapOfMapsOfObjectsGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: { [key: string]: { [key: string]: ComplexObject | undefined; } | undefined; }; }> { + public async testDecodeMapOfMapsOfObjectsGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Record | undefined>; }> { const localVarPath = this.basePath + '/test/decode/map-of/maps-of/objects'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); @@ -498,13 +498,13 @@ export class DefaultApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: { [key: string]: { [key: string]: ComplexObject | undefined; } | undefined; }; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: Record | undefined>; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "{ [key: string]: { [key: string]: ComplexObject | undefined; } | undefined; }"); + body = ObjectSerializer.deserialize(body, "Record | undefined>"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); @@ -517,7 +517,7 @@ export class DefaultApi { /** * */ - public async testDecodeMapOfObjectsGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: { [key: string]: ComplexObject | undefined | null; }; }> { + public async testDecodeMapOfObjectsGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Record; }> { const localVarPath = this.basePath + '/test/decode/map-of/objects'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); @@ -559,13 +559,13 @@ export class DefaultApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: { [key: string]: ComplexObject | undefined | null; }; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: Record; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "{ [key: string]: ComplexObject | undefined | null; }"); + body = ObjectSerializer.deserialize(body, "Record"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); @@ -578,7 +578,7 @@ export class DefaultApi { /** * */ - public async testDecodeMapOfPrimitiveGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: { [key: string]: string | undefined; }; }> { + public async testDecodeMapOfPrimitiveGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Record; }> { const localVarPath = this.basePath + '/test/decode/map-of/primitive'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); @@ -620,13 +620,13 @@ export class DefaultApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: { [key: string]: string | undefined; }; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: Record; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "{ [key: string]: string | undefined; }"); + body = ObjectSerializer.deserialize(body, "Record"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); @@ -1127,7 +1127,7 @@ export class DefaultApi { * * @param complexObject */ - public async testEncodeArrayOfMapsOfObjectsPost (complexObject: Array<{ [key: string]: ComplexObject | undefined; }>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + public async testEncodeArrayOfMapsOfObjectsPost (complexObject: Array>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { const localVarPath = this.basePath + '/test/encode/array-of/maps-of/objects'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); @@ -1149,7 +1149,7 @@ export class DefaultApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(complexObject, "Array<{ [key: string]: ComplexObject | undefined; }>") + body: ObjectSerializer.serialize(complexObject, "Array>") }; let authenticationPromise = Promise.resolve(); @@ -1427,7 +1427,7 @@ export class DefaultApi { * * @param requestBody */ - public async testEncodeMapOfMapsOfObjectsPost (requestBody: { [key: string]: { [key: string]: ComplexObject | undefined; } | undefined; }, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + public async testEncodeMapOfMapsOfObjectsPost (requestBody: Record | undefined>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { const localVarPath = this.basePath + '/test/encode/map-of/maps-of/objects'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); @@ -1449,7 +1449,7 @@ export class DefaultApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(requestBody, "{ [key: string]: { [key: string]: ComplexObject | undefined; } | undefined; }") + body: ObjectSerializer.serialize(requestBody, "Record | undefined>") }; let authenticationPromise = Promise.resolve(); @@ -1487,7 +1487,7 @@ export class DefaultApi { * * @param requestBody */ - public async testEncodeMapOfObjectsPost (requestBody: { [key: string]: ComplexObject | undefined | null; }, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + public async testEncodeMapOfObjectsPost (requestBody: Record, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { const localVarPath = this.basePath + '/test/encode/map-of/objects'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); @@ -1509,7 +1509,7 @@ export class DefaultApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(requestBody, "{ [key: string]: ComplexObject | undefined | null; }") + body: ObjectSerializer.serialize(requestBody, "Record") }; let authenticationPromise = Promise.resolve(); @@ -1547,7 +1547,7 @@ export class DefaultApi { * * @param requestBody */ - public async testEncodeMapOfPrimitivePost (requestBody: { [key: string]: string | undefined; }, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { + public async testEncodeMapOfPrimitivePost (requestBody: Record, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { const localVarPath = this.basePath + '/test/encode/map-of/primitive'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); @@ -1569,7 +1569,7 @@ export class DefaultApi { uri: localVarPath, useQuerystring: this._useQuerystring, json: true, - body: ObjectSerializer.serialize(requestBody, "{ [key: string]: string | undefined; }") + body: ObjectSerializer.serialize(requestBody, "Record") }; let authenticationPromise = Promise.resolve(); diff --git a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/store.service.ts index e2e37850a533..47ac0ab4b43f 100644 --- a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/api/store.service.ts @@ -96,9 +96,9 @@ export class StoreService extends BaseService { * @param reportProgress flag to report request and response progress. * @param options additional options */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { let localVarHeaders = this.defaultHeaders; @@ -129,7 +129,7 @@ export class StoreService extends BaseService { let localVarPath = `/store/inventory`; const { basePath, withCredentials } = this.configuration; - return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, diff --git a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/store.service.ts index f871a415dfb7..d59494559b4e 100644 --- a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/api/store.service.ts @@ -99,9 +99,9 @@ export class StoreService extends BaseService { * @param reportProgress flag to report request and response progress. * @param options additional options */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { let localVarHeaders = this.defaultHeaders; @@ -134,7 +134,7 @@ export class StoreService extends BaseService { let localVarPath = `/store/inventory`; const { basePath, withCredentials } = this.configuration; - return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/store.service.ts index f871a415dfb7..d59494559b4e 100644 --- a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/api/store.service.ts @@ -99,9 +99,9 @@ export class StoreService extends BaseService { * @param reportProgress flag to report request and response progress. * @param options additional options */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { let localVarHeaders = this.defaultHeaders; @@ -134,7 +134,7 @@ export class StoreService extends BaseService { let localVarPath = `/store/inventory`; const { basePath, withCredentials } = this.configuration; - return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/store.service.ts index f871a415dfb7..d59494559b4e 100644 --- a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/api/store.service.ts @@ -99,9 +99,9 @@ export class StoreService extends BaseService { * @param reportProgress flag to report request and response progress. * @param options additional options */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { let localVarHeaders = this.defaultHeaders; @@ -134,7 +134,7 @@ export class StoreService extends BaseService { let localVarPath = `/store/inventory`; const { basePath, withCredentials } = this.configuration; - return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, diff --git a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/store.service.ts index f871a415dfb7..d59494559b4e 100644 --- a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/api/store.service.ts @@ -99,9 +99,9 @@ export class StoreService extends BaseService { * @param reportProgress flag to report request and response progress. * @param options additional options */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { let localVarHeaders = this.defaultHeaders; @@ -134,7 +134,7 @@ export class StoreService extends BaseService { let localVarPath = `/store/inventory`; const { basePath, withCredentials } = this.configuration; - return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v19/builds/default/api/store.service.ts index f871a415dfb7..d59494559b4e 100644 --- a/samples/client/petstore/typescript-angular-v19/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v19/builds/default/api/store.service.ts @@ -99,9 +99,9 @@ export class StoreService extends BaseService { * @param reportProgress flag to report request and response progress. * @param options additional options */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { let localVarHeaders = this.defaultHeaders; @@ -134,7 +134,7 @@ export class StoreService extends BaseService { let localVarPath = `/store/inventory`; const { basePath, withCredentials } = this.configuration; - return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, diff --git a/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/api/store.service.ts index f871a415dfb7..d59494559b4e 100644 --- a/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/api/store.service.ts @@ -99,9 +99,9 @@ export class StoreService extends BaseService { * @param reportProgress flag to report request and response progress. * @param options additional options */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { let localVarHeaders = this.defaultHeaders; @@ -134,7 +134,7 @@ export class StoreService extends BaseService { let localVarPath = `/store/inventory`; const { basePath, withCredentials } = this.configuration; - return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, diff --git a/samples/client/petstore/typescript-angular-v20/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v20/builds/default/api/store.service.ts index f871a415dfb7..d59494559b4e 100644 --- a/samples/client/petstore/typescript-angular-v20/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v20/builds/default/api/store.service.ts @@ -99,9 +99,9 @@ export class StoreService extends BaseService { * @param reportProgress flag to report request and response progress. * @param options additional options */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { let localVarHeaders = this.defaultHeaders; @@ -134,7 +134,7 @@ export class StoreService extends BaseService { let localVarPath = `/store/inventory`; const { basePath, withCredentials } = this.configuration; - return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, diff --git a/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/api/store.service.ts index f871a415dfb7..d59494559b4e 100644 --- a/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/api/store.service.ts @@ -99,9 +99,9 @@ export class StoreService extends BaseService { * @param reportProgress flag to report request and response progress. * @param options additional options */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { let localVarHeaders = this.defaultHeaders; @@ -134,7 +134,7 @@ export class StoreService extends BaseService { let localVarPath = `/store/inventory`; const { basePath, withCredentials } = this.configuration; - return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, diff --git a/samples/client/petstore/typescript-angular-v21/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v21/builds/default/api/store.service.ts index f871a415dfb7..d59494559b4e 100644 --- a/samples/client/petstore/typescript-angular-v21/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v21/builds/default/api/store.service.ts @@ -99,9 +99,9 @@ export class StoreService extends BaseService { * @param reportProgress flag to report request and response progress. * @param options additional options */ - public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { let localVarHeaders = this.defaultHeaders; @@ -134,7 +134,7 @@ export class StoreService extends BaseService { let localVarPath = `/store/inventory`; const { basePath, withCredentials } = this.configuration; - return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`, + return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, diff --git a/samples/client/petstore/typescript-aurelia/default/StoreApi.ts b/samples/client/petstore/typescript-aurelia/default/StoreApi.ts index 3d88a8211928..b0a7036180b4 100644 --- a/samples/client/petstore/typescript-aurelia/default/StoreApi.ts +++ b/samples/client/petstore/typescript-aurelia/default/StoreApi.ts @@ -93,7 +93,7 @@ export class StoreApi extends Api { * Returns pet inventories by status * Returns a map of status codes to quantities */ - async getInventory(): Promise<{ [key: string]: number; }> { + async getInventory(): Promise> { // Verify required parameters are set // Create URL to call diff --git a/samples/client/petstore/typescript-axios/builds/default/api.ts b/samples/client/petstore/typescript-axios/builds/default/api.ts index 25c51b3d9ec2..64625098fe34 100644 --- a/samples/client/petstore/typescript-axios/builds/default/api.ts +++ b/samples/client/petstore/typescript-axios/builds/default/api.ts @@ -943,7 +943,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { + async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['StoreApi.getInventory']?.[localVarOperationServerIndex]?.url; @@ -1000,7 +1000,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** diff --git a/samples/client/petstore/typescript-axios/builds/default/docs/StoreApi.md b/samples/client/petstore/typescript-axios/builds/default/docs/StoreApi.md index 8b423aa85146..a0d9c3fd213e 100644 --- a/samples/client/petstore/typescript-axios/builds/default/docs/StoreApi.md +++ b/samples/client/petstore/typescript-axios/builds/default/docs/StoreApi.md @@ -62,7 +62,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getInventory** -> { [key: string]: number; } getInventory() +> Record getInventory() Returns a map of status codes to quantities @@ -86,7 +86,7 @@ This endpoint does not have any parameters. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts index 25c51b3d9ec2..64625098fe34 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts @@ -943,7 +943,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { + async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['StoreApi.getInventory']?.[localVarOperationServerIndex]?.url; @@ -1000,7 +1000,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/docs/StoreApi.md b/samples/client/petstore/typescript-axios/builds/es6-target/docs/StoreApi.md index 683a651c8815..3378a5647685 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/docs/StoreApi.md +++ b/samples/client/petstore/typescript-axios/builds/es6-target/docs/StoreApi.md @@ -62,7 +62,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getInventory** -> { [key: string]: number; } getInventory() +> Record getInventory() Returns a map of status codes to quantities @@ -86,7 +86,7 @@ This endpoint does not have any parameters. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts b/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts index 86de5e91358e..0c3ccd570a69 100644 --- a/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts +++ b/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts @@ -24,17 +24,17 @@ import type { RequestArgs } from './base'; import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base'; export interface AdditionalPropertiesClass { - 'map_property'?: { [key: string]: string; }; - 'map_of_map_property'?: { [key: string]: { [key: string]: string; }; }; + 'map_property'?: Record; + 'map_of_map_property'?: Record>; 'anytype_1'?: any; 'map_with_undeclared_properties_anytype_1'?: object; 'map_with_undeclared_properties_anytype_2'?: object; - 'map_with_undeclared_properties_anytype_3'?: { [key: string]: any; }; + 'map_with_undeclared_properties_anytype_3'?: Record; /** * an object with no declared properties and no undeclared properties, hence it\'s an empty map. */ 'empty_map'?: object; - 'map_with_undeclared_properties_string'?: { [key: string]: string; }; + 'map_with_undeclared_properties_string'?: Record; } /** * Object with allOf ref to double @@ -328,10 +328,10 @@ export const MammalAnyofTypeEnum = { export type MammalAnyofTypeEnum = typeof MammalAnyofTypeEnum[keyof typeof MammalAnyofTypeEnum]; export interface MapTest { - 'map_map_of_string'?: { [key: string]: { [key: string]: string; }; }; - 'map_of_enum_string'?: { [key: string]: string; }; - 'direct_map'?: { [key: string]: boolean; }; - 'indirect_map'?: { [key: string]: boolean; }; + 'map_map_of_string'?: Record>; + 'map_of_enum_string'?: Record; + 'direct_map'?: Record; + 'indirect_map'?: Record; } export const MapTestMapOfEnumStringEnum = { @@ -344,7 +344,7 @@ export type MapTestMapOfEnumStringEnum = typeof MapTestMapOfEnumStringEnum[keyof export interface MixedPropertiesAndAdditionalPropertiesClass { 'uuid'?: string; 'dateTime'?: string; - 'map'?: { [key: string]: Animal; }; + 'map'?: Record; } /** * Model for testing model name starting with number @@ -383,9 +383,9 @@ export interface NullableClass { 'array_nullable_prop'?: Array | null; 'array_and_items_nullable_prop'?: Array | null; 'array_items_nullable'?: Array; - 'object_nullable_prop'?: { [key: string]: object; } | null; - 'object_and_items_nullable_prop'?: { [key: string]: object | null; } | null; - 'object_items_nullable'?: { [key: string]: object | null; }; + 'object_nullable_prop'?: Record | null; + 'object_and_items_nullable_prop'?: Record | null; + 'object_items_nullable'?: Record; } /** * @type NullableShape @@ -1034,11 +1034,11 @@ export const FakeApiAxiosParamCreator = function (configuration?: Configuration) /** * * @summary test referenced additionalProperties - * @param {{ [key: string]: any; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testAdditionalPropertiesReference: async (requestBody: { [key: string]: any; }, options: RawAxiosRequestConfig = {}): Promise => { + testAdditionalPropertiesReference: async (requestBody: Record, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'requestBody' is not null or undefined assertParamExists('testAdditionalPropertiesReference', 'requestBody', requestBody) const localVarPath = `/fake/additionalProperties-reference`; @@ -1432,11 +1432,11 @@ export const FakeApiAxiosParamCreator = function (configuration?: Configuration) /** * * @summary test inline additionalProperties - * @param {{ [key: string]: string; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testInlineAdditionalProperties: async (requestBody: { [key: string]: string; }, options: RawAxiosRequestConfig = {}): Promise => { + testInlineAdditionalProperties: async (requestBody: Record, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'requestBody' is not null or undefined assertParamExists('testInlineAdditionalProperties', 'requestBody', requestBody) const localVarPath = `/fake/inline-additionalProperties`; @@ -1609,11 +1609,11 @@ export const FakeApiAxiosParamCreator = function (configuration?: Configuration) /** * * @summary test referenced string map - * @param {{ [key: string]: string; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testStringMapReference: async (requestBody: { [key: string]: string; }, options: RawAxiosRequestConfig = {}): Promise => { + testStringMapReference: async (requestBody: Record, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'requestBody' is not null or undefined assertParamExists('testStringMapReference', 'requestBody', requestBody) const localVarPath = `/fake/stringMap-reference`; @@ -1737,11 +1737,11 @@ export const FakeApiFp = function(configuration?: Configuration) { /** * * @summary test referenced additionalProperties - * @param {{ [key: string]: any; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async testAdditionalPropertiesReference(requestBody: { [key: string]: any; }, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async testAdditionalPropertiesReference(requestBody: Record, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.testAdditionalPropertiesReference(requestBody, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['FakeApi.testAdditionalPropertiesReference']?.[localVarOperationServerIndex]?.url; @@ -1852,11 +1852,11 @@ export const FakeApiFp = function(configuration?: Configuration) { /** * * @summary test inline additionalProperties - * @param {{ [key: string]: string; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async testInlineAdditionalProperties(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async testInlineAdditionalProperties(requestBody: Record, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.testInlineAdditionalProperties(requestBody, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['FakeApi.testInlineAdditionalProperties']?.[localVarOperationServerIndex]?.url; @@ -1908,11 +1908,11 @@ export const FakeApiFp = function(configuration?: Configuration) { /** * * @summary test referenced string map - * @param {{ [key: string]: string; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async testStringMapReference(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async testStringMapReference(requestBody: Record, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.testStringMapReference(requestBody, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['FakeApi.testStringMapReference']?.[localVarOperationServerIndex]?.url; @@ -1994,11 +1994,11 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? /** * * @summary test referenced additionalProperties - * @param {{ [key: string]: any; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testAdditionalPropertiesReference(requestBody: { [key: string]: any; }, options?: RawAxiosRequestConfig): AxiosPromise { + testAdditionalPropertiesReference(requestBody: Record, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testAdditionalPropertiesReference(requestBody, options).then((request) => request(axios, basePath)); }, /** @@ -2088,11 +2088,11 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? /** * * @summary test inline additionalProperties - * @param {{ [key: string]: string; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testInlineAdditionalProperties(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig): AxiosPromise { + testInlineAdditionalProperties(requestBody: Record, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testInlineAdditionalProperties(requestBody, options).then((request) => request(axios, basePath)); }, /** @@ -2132,11 +2132,11 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? /** * * @summary test referenced string map - * @param {{ [key: string]: string; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testStringMapReference(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig): AxiosPromise { + testStringMapReference(requestBody: Record, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testStringMapReference(requestBody, options).then((request) => request(axios, basePath)); }, }; @@ -2220,11 +2220,11 @@ export class FakeApi extends BaseAPI { /** * * @summary test referenced additionalProperties - * @param {{ [key: string]: any; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - public testAdditionalPropertiesReference(requestBody: { [key: string]: any; }, options?: RawAxiosRequestConfig) { + public testAdditionalPropertiesReference(requestBody: Record, options?: RawAxiosRequestConfig) { return FakeApiFp(this.configuration).testAdditionalPropertiesReference(requestBody, options).then((request) => request(this.axios, this.basePath)); } @@ -2321,11 +2321,11 @@ export class FakeApi extends BaseAPI { /** * * @summary test inline additionalProperties - * @param {{ [key: string]: string; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - public testInlineAdditionalProperties(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig) { + public testInlineAdditionalProperties(requestBody: Record, options?: RawAxiosRequestConfig) { return FakeApiFp(this.configuration).testInlineAdditionalProperties(requestBody, options).then((request) => request(this.axios, this.basePath)); } @@ -2369,11 +2369,11 @@ export class FakeApi extends BaseAPI { /** * * @summary test referenced string map - * @param {{ [key: string]: string; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - public testStringMapReference(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig) { + public testStringMapReference(requestBody: Record, options?: RawAxiosRequestConfig) { return FakeApiFp(this.configuration).testStringMapReference(requestBody, options).then((request) => request(this.axios, this.basePath)); } } @@ -3464,7 +3464,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { + async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['StoreApi.getInventory']?.[localVarOperationServerIndex]?.url; @@ -3521,7 +3521,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** diff --git a/samples/client/petstore/typescript-axios/builds/test-petstore/docs/AdditionalPropertiesClass.md b/samples/client/petstore/typescript-axios/builds/test-petstore/docs/AdditionalPropertiesClass.md index ef8f91407865..0fed7c004877 100644 --- a/samples/client/petstore/typescript-axios/builds/test-petstore/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/typescript-axios/builds/test-petstore/docs/AdditionalPropertiesClass.md @@ -5,14 +5,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**map_property** | **{ [key: string]: string; }** | | [optional] [default to undefined] -**map_of_map_property** | **{ [key: string]: { [key: string]: string; }; }** | | [optional] [default to undefined] +**map_property** | **Record<string, string>** | | [optional] [default to undefined] +**map_of_map_property** | **Record<string, Record<string, string>>** | | [optional] [default to undefined] **anytype_1** | **any** | | [optional] [default to undefined] **map_with_undeclared_properties_anytype_1** | **object** | | [optional] [default to undefined] **map_with_undeclared_properties_anytype_2** | **object** | | [optional] [default to undefined] -**map_with_undeclared_properties_anytype_3** | **{ [key: string]: any; }** | | [optional] [default to undefined] +**map_with_undeclared_properties_anytype_3** | **Record<string, any>** | | [optional] [default to undefined] **empty_map** | **object** | an object with no declared properties and no undeclared properties, hence it\'s an empty map. | [optional] [default to undefined] -**map_with_undeclared_properties_string** | **{ [key: string]: string; }** | | [optional] [default to undefined] +**map_with_undeclared_properties_string** | **Record<string, string>** | | [optional] [default to undefined] ## Example diff --git a/samples/client/petstore/typescript-axios/builds/test-petstore/docs/FakeApi.md b/samples/client/petstore/typescript-axios/builds/test-petstore/docs/FakeApi.md index ad04911b6a7d..4eded08f9fbf 100644 --- a/samples/client/petstore/typescript-axios/builds/test-petstore/docs/FakeApi.md +++ b/samples/client/petstore/typescript-axios/builds/test-petstore/docs/FakeApi.md @@ -381,7 +381,7 @@ import { const configuration = new Configuration(); const apiInstance = new FakeApi(configuration); -let requestBody: { [key: string]: any; }; //request body +let requestBody: Record; //request body const { status, data } = await apiInstance.testAdditionalPropertiesReference( requestBody @@ -392,7 +392,7 @@ const { status, data } = await apiInstance.testAdditionalPropertiesReference( |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| -| **requestBody** | **{ [key: string]: any; }**| request body | | +| **requestBody** | **Record**| request body | | ### Return type @@ -820,7 +820,7 @@ import { const configuration = new Configuration(); const apiInstance = new FakeApi(configuration); -let requestBody: { [key: string]: string; }; //request body +let requestBody: Record; //request body const { status, data } = await apiInstance.testInlineAdditionalProperties( requestBody @@ -831,7 +831,7 @@ const { status, data } = await apiInstance.testInlineAdditionalProperties( |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| -| **requestBody** | **{ [key: string]: string; }**| request body | | +| **requestBody** | **Record**| request body | | ### Return type @@ -1040,7 +1040,7 @@ import { const configuration = new Configuration(); const apiInstance = new FakeApi(configuration); -let requestBody: { [key: string]: string; }; //request body +let requestBody: Record; //request body const { status, data } = await apiInstance.testStringMapReference( requestBody @@ -1051,7 +1051,7 @@ const { status, data } = await apiInstance.testStringMapReference( |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| -| **requestBody** | **{ [key: string]: string; }**| request body | | +| **requestBody** | **Record**| request body | | ### Return type diff --git a/samples/client/petstore/typescript-axios/builds/test-petstore/docs/MapTest.md b/samples/client/petstore/typescript-axios/builds/test-petstore/docs/MapTest.md index c92eb7242cce..05f5c5ac8c48 100644 --- a/samples/client/petstore/typescript-axios/builds/test-petstore/docs/MapTest.md +++ b/samples/client/petstore/typescript-axios/builds/test-petstore/docs/MapTest.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**map_map_of_string** | **{ [key: string]: { [key: string]: string; }; }** | | [optional] [default to undefined] -**map_of_enum_string** | **{ [key: string]: string; }** | | [optional] [default to undefined] -**direct_map** | **{ [key: string]: boolean; }** | | [optional] [default to undefined] -**indirect_map** | **{ [key: string]: boolean; }** | | [optional] [default to undefined] +**map_map_of_string** | **Record<string, Record<string, string>>** | | [optional] [default to undefined] +**map_of_enum_string** | **Record<string, string>** | | [optional] [default to undefined] +**direct_map** | **Record<string, boolean>** | | [optional] [default to undefined] +**indirect_map** | **Record<string, boolean>** | | [optional] [default to undefined] ## Example diff --git a/samples/client/petstore/typescript-axios/builds/test-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/typescript-axios/builds/test-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md index b9d3f3c995c0..fd76ec3d3729 100644 --- a/samples/client/petstore/typescript-axios/builds/test-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/typescript-axios/builds/test-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **uuid** | **string** | | [optional] [default to undefined] **dateTime** | **string** | | [optional] [default to undefined] -**map** | [**{ [key: string]: Animal; }**](Animal.md) | | [optional] [default to undefined] +**map** | [**Record<string, Animal>**](Animal.md) | | [optional] [default to undefined] ## Example diff --git a/samples/client/petstore/typescript-axios/builds/test-petstore/docs/NullableClass.md b/samples/client/petstore/typescript-axios/builds/test-petstore/docs/NullableClass.md index 61c6a9e2c37b..d930be9511f8 100644 --- a/samples/client/petstore/typescript-axios/builds/test-petstore/docs/NullableClass.md +++ b/samples/client/petstore/typescript-axios/builds/test-petstore/docs/NullableClass.md @@ -14,9 +14,9 @@ Name | Type | Description | Notes **array_nullable_prop** | **Array<object>** | | [optional] [default to undefined] **array_and_items_nullable_prop** | **Array<object | null>** | | [optional] [default to undefined] **array_items_nullable** | **Array<object | null>** | | [optional] [default to undefined] -**object_nullable_prop** | **{ [key: string]: object; }** | | [optional] [default to undefined] -**object_and_items_nullable_prop** | **{ [key: string]: object | null; }** | | [optional] [default to undefined] -**object_items_nullable** | **{ [key: string]: object | null; }** | | [optional] [default to undefined] +**object_nullable_prop** | **Record<string, object>** | | [optional] [default to undefined] +**object_and_items_nullable_prop** | **Record<string, object | null>** | | [optional] [default to undefined] +**object_items_nullable** | **Record<string, object | null>** | | [optional] [default to undefined] ## Example diff --git a/samples/client/petstore/typescript-axios/builds/test-petstore/docs/StoreApi.md b/samples/client/petstore/typescript-axios/builds/test-petstore/docs/StoreApi.md index 6f04cd4edacf..a19b47838766 100644 --- a/samples/client/petstore/typescript-axios/builds/test-petstore/docs/StoreApi.md +++ b/samples/client/petstore/typescript-axios/builds/test-petstore/docs/StoreApi.md @@ -62,7 +62,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getInventory** -> { [key: string]: number; } getInventory() +> Record getInventory() Returns a map of status codes to quantities @@ -86,7 +86,7 @@ This endpoint does not have any parameters. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts index 915bde0c28a1..7563798956e5 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts @@ -985,7 +985,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { + async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['StoreApi.getInventory']?.[localVarOperationServerIndex]?.url; @@ -1042,7 +1042,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/docs/StoreApi.md b/samples/client/petstore/typescript-axios/builds/with-complex-headers/docs/StoreApi.md index 4f67208993d1..992c98ee6b5b 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/docs/StoreApi.md +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/docs/StoreApi.md @@ -62,7 +62,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getInventory** -> { [key: string]: number; } getInventory() +> Record getInventory() Returns a map of status codes to quantities @@ -86,7 +86,7 @@ This endpoint does not have any parameters. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts index 6b0430e50cd6..1f2c4e4b8426 100644 --- a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts @@ -24,8 +24,8 @@ import type { RequestArgs } from './base'; import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base'; export interface AdditionalPropertiesClass { - 'map_property'?: { [key: string]: string; }; - 'map_of_map_property'?: { [key: string]: { [key: string]: string; }; }; + 'map_property'?: Record; + 'map_of_map_property'?: Record>; } export interface Animal { 'className': string; @@ -226,10 +226,10 @@ export interface List { export type Mammal = { className: 'whale' } & Whale | { className: 'zebra' } & Zebra; export interface MapTest { - 'map_map_of_string'?: { [key: string]: { [key: string]: string; }; }; - 'map_of_enum_string'?: { [key: string]: string; }; - 'direct_map'?: { [key: string]: boolean; }; - 'indirect_map'?: { [key: string]: boolean; }; + 'map_map_of_string'?: Record>; + 'map_of_enum_string'?: Record; + 'direct_map'?: Record; + 'indirect_map'?: Record; } export const MapTestMapOfEnumStringEnum = { @@ -242,7 +242,7 @@ export type MapTestMapOfEnumStringEnum = typeof MapTestMapOfEnumStringEnum[keyof export interface MixedPropertiesAndAdditionalPropertiesClass { 'uuid'?: string; 'dateTime'?: string; - 'map'?: { [key: string]: Animal; }; + 'map'?: Record; } /** * Model for testing model name starting with number @@ -281,9 +281,9 @@ export interface NullableClass { 'array_nullable_prop'?: Array | null; 'array_and_items_nullable_prop'?: Array | null; 'array_items_nullable'?: Array; - 'object_nullable_prop'?: { [key: string]: object; } | null; - 'object_and_items_nullable_prop'?: { [key: string]: object | null; } | null; - 'object_items_nullable'?: { [key: string]: object | null; }; + 'object_nullable_prop'?: Record | null; + 'object_and_items_nullable_prop'?: Record | null; + 'object_items_nullable'?: Record; } export interface NumberOnly { 'JustNumber'?: number; @@ -811,11 +811,11 @@ export const FakeApiAxiosParamCreator = function (configuration?: Configuration) /** * * @summary test referenced additionalProperties - * @param {{ [key: string]: any; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testAdditionalPropertiesReference: async (requestBody: { [key: string]: any; }, options: RawAxiosRequestConfig = {}): Promise => { + testAdditionalPropertiesReference: async (requestBody: Record, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'requestBody' is not null or undefined assertParamExists('testAdditionalPropertiesReference', 'requestBody', requestBody) const localVarPath = `/fake/additionalProperties-reference`; @@ -1209,11 +1209,11 @@ export const FakeApiAxiosParamCreator = function (configuration?: Configuration) /** * * @summary test inline additionalProperties - * @param {{ [key: string]: string; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testInlineAdditionalProperties: async (requestBody: { [key: string]: string; }, options: RawAxiosRequestConfig = {}): Promise => { + testInlineAdditionalProperties: async (requestBody: Record, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'requestBody' is not null or undefined assertParamExists('testInlineAdditionalProperties', 'requestBody', requestBody) const localVarPath = `/fake/inline-additionalProperties`; @@ -1386,11 +1386,11 @@ export const FakeApiAxiosParamCreator = function (configuration?: Configuration) /** * * @summary test referenced string map - * @param {{ [key: string]: string; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testStringMapReference: async (requestBody: { [key: string]: string; }, options: RawAxiosRequestConfig = {}): Promise => { + testStringMapReference: async (requestBody: Record, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'requestBody' is not null or undefined assertParamExists('testStringMapReference', 'requestBody', requestBody) const localVarPath = `/fake/stringMap-reference`; @@ -1532,11 +1532,11 @@ export const FakeApiFp = function(configuration?: Configuration) { /** * * @summary test referenced additionalProperties - * @param {{ [key: string]: any; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async testAdditionalPropertiesReference(requestBody: { [key: string]: any; }, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async testAdditionalPropertiesReference(requestBody: Record, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.testAdditionalPropertiesReference(requestBody, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['FakeApi.testAdditionalPropertiesReference']?.[localVarOperationServerIndex]?.url; @@ -1647,11 +1647,11 @@ export const FakeApiFp = function(configuration?: Configuration) { /** * * @summary test inline additionalProperties - * @param {{ [key: string]: string; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async testInlineAdditionalProperties(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async testInlineAdditionalProperties(requestBody: Record, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.testInlineAdditionalProperties(requestBody, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['FakeApi.testInlineAdditionalProperties']?.[localVarOperationServerIndex]?.url; @@ -1703,11 +1703,11 @@ export const FakeApiFp = function(configuration?: Configuration) { /** * * @summary test referenced string map - * @param {{ [key: string]: string; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async testStringMapReference(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async testStringMapReference(requestBody: Record, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.testStringMapReference(requestBody, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['FakeApi.testStringMapReference']?.[localVarOperationServerIndex]?.url; @@ -1783,11 +1783,11 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? /** * * @summary test referenced additionalProperties - * @param {{ [key: string]: any; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testAdditionalPropertiesReference(requestBody: { [key: string]: any; }, options?: RawAxiosRequestConfig): AxiosPromise { + testAdditionalPropertiesReference(requestBody: Record, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testAdditionalPropertiesReference(requestBody, options).then((request) => request(axios, basePath)); }, /** @@ -1877,11 +1877,11 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? /** * * @summary test inline additionalProperties - * @param {{ [key: string]: string; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testInlineAdditionalProperties(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig): AxiosPromise { + testInlineAdditionalProperties(requestBody: Record, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testInlineAdditionalProperties(requestBody, options).then((request) => request(axios, basePath)); }, /** @@ -1921,11 +1921,11 @@ export const FakeApiFactory = function (configuration?: Configuration, basePath? /** * * @summary test referenced string map - * @param {{ [key: string]: string; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - testStringMapReference(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig): AxiosPromise { + testStringMapReference(requestBody: Record, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.testStringMapReference(requestBody, options).then((request) => request(axios, basePath)); }, /** @@ -1998,11 +1998,11 @@ export class FakeApi extends BaseAPI { /** * * @summary test referenced additionalProperties - * @param {{ [key: string]: any; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - public testAdditionalPropertiesReference(requestBody: { [key: string]: any; }, options?: RawAxiosRequestConfig) { + public testAdditionalPropertiesReference(requestBody: Record, options?: RawAxiosRequestConfig) { return FakeApiFp(this.configuration).testAdditionalPropertiesReference(requestBody, options).then((request) => request(this.axios, this.basePath)); } @@ -2099,11 +2099,11 @@ export class FakeApi extends BaseAPI { /** * * @summary test inline additionalProperties - * @param {{ [key: string]: string; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - public testInlineAdditionalProperties(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig) { + public testInlineAdditionalProperties(requestBody: Record, options?: RawAxiosRequestConfig) { return FakeApiFp(this.configuration).testInlineAdditionalProperties(requestBody, options).then((request) => request(this.axios, this.basePath)); } @@ -2147,11 +2147,11 @@ export class FakeApi extends BaseAPI { /** * * @summary test referenced string map - * @param {{ [key: string]: string; }} requestBody request body + * @param {Record} requestBody request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ - public testStringMapReference(requestBody: { [key: string]: string; }, options?: RawAxiosRequestConfig) { + public testStringMapReference(requestBody: Record, options?: RawAxiosRequestConfig) { return FakeApiFp(this.configuration).testStringMapReference(requestBody, options).then((request) => request(this.axios, this.basePath)); } @@ -3253,7 +3253,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { + async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['StoreApi.getInventory']?.[localVarOperationServerIndex]?.url; @@ -3310,7 +3310,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** diff --git a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/AdditionalPropertiesClass.md b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/AdditionalPropertiesClass.md index de474cf74e9d..8d35c82a4e47 100644 --- a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/AdditionalPropertiesClass.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**map_property** | **{ [key: string]: string; }** | | [optional] [default to undefined] -**map_of_map_property** | **{ [key: string]: { [key: string]: string; }; }** | | [optional] [default to undefined] +**map_property** | **Record<string, string>** | | [optional] [default to undefined] +**map_of_map_property** | **Record<string, Record<string, string>>** | | [optional] [default to undefined] ## Example diff --git a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/FakeApi.md b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/FakeApi.md index 1fb1e763b333..de232b05a169 100644 --- a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/FakeApi.md +++ b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/FakeApi.md @@ -287,7 +287,7 @@ import { const configuration = new Configuration(); const apiInstance = new FakeApi(configuration); -let requestBody: { [key: string]: any; }; //request body +let requestBody: Record; //request body const { status, data } = await apiInstance.testAdditionalPropertiesReference( requestBody @@ -298,7 +298,7 @@ const { status, data } = await apiInstance.testAdditionalPropertiesReference( |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| -| **requestBody** | **{ [key: string]: any; }**| request body | | +| **requestBody** | **Record**| request body | | ### Return type @@ -726,7 +726,7 @@ import { const configuration = new Configuration(); const apiInstance = new FakeApi(configuration); -let requestBody: { [key: string]: string; }; //request body +let requestBody: Record; //request body const { status, data } = await apiInstance.testInlineAdditionalProperties( requestBody @@ -737,7 +737,7 @@ const { status, data } = await apiInstance.testInlineAdditionalProperties( |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| -| **requestBody** | **{ [key: string]: string; }**| request body | | +| **requestBody** | **Record**| request body | | ### Return type @@ -946,7 +946,7 @@ import { const configuration = new Configuration(); const apiInstance = new FakeApi(configuration); -let requestBody: { [key: string]: string; }; //request body +let requestBody: Record; //request body const { status, data } = await apiInstance.testStringMapReference( requestBody @@ -957,7 +957,7 @@ const { status, data } = await apiInstance.testStringMapReference( |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| -| **requestBody** | **{ [key: string]: string; }**| request body | | +| **requestBody** | **Record**| request body | | ### Return type diff --git a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/MapTest.md b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/MapTest.md index c92eb7242cce..05f5c5ac8c48 100644 --- a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/MapTest.md +++ b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/MapTest.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**map_map_of_string** | **{ [key: string]: { [key: string]: string; }; }** | | [optional] [default to undefined] -**map_of_enum_string** | **{ [key: string]: string; }** | | [optional] [default to undefined] -**direct_map** | **{ [key: string]: boolean; }** | | [optional] [default to undefined] -**indirect_map** | **{ [key: string]: boolean; }** | | [optional] [default to undefined] +**map_map_of_string** | **Record<string, Record<string, string>>** | | [optional] [default to undefined] +**map_of_enum_string** | **Record<string, string>** | | [optional] [default to undefined] +**direct_map** | **Record<string, boolean>** | | [optional] [default to undefined] +**indirect_map** | **Record<string, boolean>** | | [optional] [default to undefined] ## Example diff --git a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/MixedPropertiesAndAdditionalPropertiesClass.md index b9d3f3c995c0..fd76ec3d3729 100644 --- a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **uuid** | **string** | | [optional] [default to undefined] **dateTime** | **string** | | [optional] [default to undefined] -**map** | [**{ [key: string]: Animal; }**](Animal.md) | | [optional] [default to undefined] +**map** | [**Record<string, Animal>**](Animal.md) | | [optional] [default to undefined] ## Example diff --git a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/NullableClass.md b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/NullableClass.md index 8570a953e2f4..2960eb1453e3 100644 --- a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/NullableClass.md +++ b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/NullableClass.md @@ -14,9 +14,9 @@ Name | Type | Description | Notes **array_nullable_prop** | **Array<object>** | | [optional] [default to undefined] **array_and_items_nullable_prop** | **Array<object | null>** | | [optional] [default to undefined] **array_items_nullable** | **Array<object | null>** | | [optional] [default to undefined] -**object_nullable_prop** | **{ [key: string]: object; }** | | [optional] [default to undefined] -**object_and_items_nullable_prop** | **{ [key: string]: object | null; }** | | [optional] [default to undefined] -**object_items_nullable** | **{ [key: string]: object | null; }** | | [optional] [default to undefined] +**object_nullable_prop** | **Record<string, object>** | | [optional] [default to undefined] +**object_and_items_nullable_prop** | **Record<string, object | null>** | | [optional] [default to undefined] +**object_items_nullable** | **Record<string, object | null>** | | [optional] [default to undefined] ## Example diff --git a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/StoreApi.md b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/StoreApi.md index 6f04cd4edacf..a19b47838766 100644 --- a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/StoreApi.md +++ b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/docs/StoreApi.md @@ -62,7 +62,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getInventory** -> { [key: string]: number; } getInventory() +> Record getInventory() Returns a map of status codes to quantities @@ -86,7 +86,7 @@ This endpoint does not have any parameters. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/api.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/api.ts index 5018ab2c830e..4161b2aa7477 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/api.ts @@ -1114,7 +1114,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { + async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['StoreApi.getInventory']?.[localVarOperationServerIndex]?.url; @@ -1171,7 +1171,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** @@ -1216,7 +1216,7 @@ export interface StoreApiInterface { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }>; + getInventory(options?: RawAxiosRequestConfig): AxiosPromise>; /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/docs/StoreApi.md b/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/docs/StoreApi.md index 8b423aa85146..a0d9c3fd213e 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/docs/StoreApi.md +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/docs/StoreApi.md @@ -62,7 +62,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getInventory** -> { [key: string]: number; } getInventory() +> Record getInventory() Returns a map of status codes to quantities @@ -86,7 +86,7 @@ This endpoint does not have any parameters. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts index fac98cb24f49..b0a268d5218a 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts @@ -1027,7 +1027,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { + async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['StoreApi.getInventory']?.[localVarOperationServerIndex]?.url; @@ -1084,7 +1084,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** @@ -1129,7 +1129,7 @@ export interface StoreApiInterface { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }>; + getInventory(options?: RawAxiosRequestConfig): AxiosPromise>; /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/docs/StoreApi.md b/samples/client/petstore/typescript-axios/builds/with-interfaces/docs/StoreApi.md index 8b423aa85146..a0d9c3fd213e 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/docs/StoreApi.md +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/docs/StoreApi.md @@ -62,7 +62,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getInventory** -> { [key: string]: number; } getInventory() +> Record getInventory() Returns a map of status codes to quantities @@ -86,7 +86,7 @@ This endpoint does not have any parameters. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts b/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts index 0a6819c15fa9..561e6ff31e6d 100644 --- a/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts @@ -945,7 +945,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { + async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['StoreApi.getInventory']?.[localVarOperationServerIndex]?.url; @@ -1002,7 +1002,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/docs/StoreApi.md b/samples/client/petstore/typescript-axios/builds/with-node-imports/docs/StoreApi.md index 3ada30dc5dc6..00947db45419 100644 --- a/samples/client/petstore/typescript-axios/builds/with-node-imports/docs/StoreApi.md +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/docs/StoreApi.md @@ -62,7 +62,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getInventory** -> { [key: string]: number; } getInventory() +> Record getInventory() Returns a map of status codes to quantities @@ -86,7 +86,7 @@ This endpoint does not have any parameters. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts index 2f1d324c3e96..6330d967f567 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts @@ -191,7 +191,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { + async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['StoreApi.getInventory']?.[localVarOperationServerIndex]?.url; @@ -248,7 +248,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/docs/StoreApi.md b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/docs/StoreApi.md index 683a651c8815..3378a5647685 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/docs/StoreApi.md +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/docs/StoreApi.md @@ -62,7 +62,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getInventory** -> { [key: string]: number; } getInventory() +> Record getInventory() Returns a map of status codes to quantities @@ -86,7 +86,7 @@ This endpoint does not have any parameters. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts index 25c51b3d9ec2..64625098fe34 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts @@ -943,7 +943,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { + async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['StoreApi.getInventory']?.[localVarOperationServerIndex]?.url; @@ -1000,7 +1000,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/docs/StoreApi.md b/samples/client/petstore/typescript-axios/builds/with-npm-version/docs/StoreApi.md index 683a651c8815..3378a5647685 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/docs/StoreApi.md +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/docs/StoreApi.md @@ -62,7 +62,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getInventory** -> { [key: string]: number; } getInventory() +> Record getInventory() Returns a map of status codes to quantities @@ -86,7 +86,7 @@ This endpoint does not have any parameters. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts index d1d084378b37..38cde4e26c60 100644 --- a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts @@ -1033,7 +1033,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { + async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['StoreApi.getInventory']?.[localVarOperationServerIndex]?.url; @@ -1090,7 +1090,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/docs/StoreApi.md b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/docs/StoreApi.md index 3ada30dc5dc6..00947db45419 100644 --- a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/docs/StoreApi.md +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/docs/StoreApi.md @@ -62,7 +62,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getInventory** -> { [key: string]: number; } getInventory() +> Record getInventory() Returns a map of status codes to quantities @@ -86,7 +86,7 @@ This endpoint does not have any parameters. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-axios/builds/with-string-enums/api.ts b/samples/client/petstore/typescript-axios/builds/with-string-enums/api.ts index 1579fe519606..29a04fbc3365 100644 --- a/samples/client/petstore/typescript-axios/builds/with-string-enums/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-string-enums/api.ts @@ -938,7 +938,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { + async getInventory(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['StoreApi.getInventory']?.[localVarOperationServerIndex]?.url; @@ -995,7 +995,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: number; }> { + getInventory(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** diff --git a/samples/client/petstore/typescript-axios/builds/with-string-enums/docs/StoreApi.md b/samples/client/petstore/typescript-axios/builds/with-string-enums/docs/StoreApi.md index 8b423aa85146..a0d9c3fd213e 100644 --- a/samples/client/petstore/typescript-axios/builds/with-string-enums/docs/StoreApi.md +++ b/samples/client/petstore/typescript-axios/builds/with-string-enums/docs/StoreApi.md @@ -62,7 +62,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getInventory** -> { [key: string]: number; } getInventory() +> Record getInventory() Returns a map of status codes to quantities @@ -86,7 +86,7 @@ This endpoint does not have any parameters. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts index 0eef4125671b..b76861c02550 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts @@ -79,7 +79,7 @@ export interface FakePropertyEnumIntegerSerializeRequest { } export interface TestAdditionalPropertiesReferenceRequest { - requestBody: { [key: string]: any; }; + requestBody: Record; } export interface TestBodyWithBinaryRequest { @@ -138,7 +138,7 @@ export interface TestGroupParametersRequest { } export interface TestInlineAdditionalPropertiesRequest { - requestBody: { [key: string]: string; }; + requestBody: Record; } export interface TestInlineFreeformAdditionalPropertiesOperationRequest { @@ -165,7 +165,7 @@ export interface TestQueryParameterCollectionFormatRequest { } export interface TestStringMapReferenceRequest { - requestBody: { [key: string]: string; }; + requestBody: Record; } /** diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/StoreApi.ts index 3ba8c2cab723..b7bc68b897d6 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/StoreApi.ts @@ -81,7 +81,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; @@ -107,7 +107,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: number; }> { + async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.getInventoryRaw(initOverrides); return await response.value(); } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/AdditionalPropertiesClass.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/AdditionalPropertiesClass.md index 57a49c2172f4..503ca5a70721 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/AdditionalPropertiesClass.md @@ -6,8 +6,8 @@ Name | Type ------------ | ------------- -`mapProperty` | { [key: string]: string; } -`mapOfMapProperty` | { [key: string]: { [key: string]: string; }; } +`mapProperty` | Record<string, string> +`mapOfMapProperty` | Record<string, Record<string, string>> ## Example diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeApi.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeApi.md index 9a679499c16f..5d7450f1d0fb 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeApi.md +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeApi.md @@ -577,7 +577,7 @@ async function example() { const api = new FakeApi(); const body = { - // { [key: string]: any; } | request body + // Record | request body requestBody: Object, } satisfies TestAdditionalPropertiesReferenceRequest; @@ -598,7 +598,7 @@ example().catch(console.error); | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **requestBody** | `{ [key: string]: any; }` | request body | | +| **requestBody** | `Record` | request body | | ### Return type @@ -1203,7 +1203,7 @@ async function example() { const api = new FakeApi(); const body = { - // { [key: string]: string; } | request body + // Record | request body requestBody: ..., } satisfies TestInlineAdditionalPropertiesRequest; @@ -1224,7 +1224,7 @@ example().catch(console.error); | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **requestBody** | `{ [key: string]: string; }` | request body | | +| **requestBody** | `Record` | request body | | ### Return type @@ -1559,7 +1559,7 @@ async function example() { const api = new FakeApi(); const body = { - // { [key: string]: string; } | request body + // Record | request body requestBody: ..., } satisfies TestStringMapReferenceRequest; @@ -1580,7 +1580,7 @@ example().catch(console.error); | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **requestBody** | `{ [key: string]: string; }` | request body | | +| **requestBody** | `Record` | request body | | ### Return type diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeBigDecimalMap200Response.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeBigDecimalMap200Response.md index 55decbceae7a..5da6b9fa4d09 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeBigDecimalMap200Response.md +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/FakeBigDecimalMap200Response.md @@ -7,7 +7,7 @@ Name | Type ------------ | ------------- `someId` | number -`someMap` | { [key: string]: number; } +`someMap` | Record<string, number> ## Example diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/MapTest.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/MapTest.md index dfb73cded89a..cceb87a38804 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/MapTest.md +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/MapTest.md @@ -6,10 +6,10 @@ Name | Type ------------ | ------------- -`mapMapOfString` | { [key: string]: { [key: string]: string; }; } -`mapOfEnumString` | { [key: string]: string; } -`directMap` | { [key: string]: boolean; } -`indirectMap` | { [key: string]: boolean; } +`mapMapOfString` | Record<string, Record<string, string>> +`mapOfEnumString` | Record<string, string> +`directMap` | Record<string, boolean> +`indirectMap` | Record<string, boolean> ## Example diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 7113d7669471..641bc577d74e 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -8,7 +8,7 @@ Name | Type ------------ | ------------- `uuid` | string `dateTime` | Date -`map` | [{ [key: string]: Animal; }](Animal.md) +`map` | [Record<string, Animal>](Animal.md) ## Example diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/NullableClass.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/NullableClass.md index 70d7011287c9..5f2e98f5acda 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/NullableClass.md +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/NullableClass.md @@ -15,9 +15,9 @@ Name | Type `arrayNullableProp` | Array<object> `arrayAndItemsNullableProp` | Array<object | null> `arrayItemsNullable` | Array<object | null> -`objectNullableProp` | { [key: string]: object; } -`objectAndItemsNullableProp` | { [key: string]: object | null; } -`objectItemsNullable` | { [key: string]: object | null; } +`objectNullableProp` | Record<string, object> +`objectAndItemsNullableProp` | Record<string, object | null> +`objectItemsNullable` | Record<string, object | null> ## Example diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/StoreApi.md index 9f6136a7714e..43cd31d94823 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/StoreApi.md +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/docs/StoreApi.md @@ -81,7 +81,7 @@ No authorization required ## getInventory -> { [key: string]: number; } getInventory() +> Record<string, number> getInventory() Returns pet inventories by status @@ -122,7 +122,7 @@ This endpoint does not need any parameter. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/AdditionalPropertiesClass.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/AdditionalPropertiesClass.ts index d470576ef7d3..662afa6a219b 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/AdditionalPropertiesClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/AdditionalPropertiesClass.ts @@ -21,16 +21,16 @@ import { mapValues } from '../runtime'; export interface AdditionalPropertiesClass { /** * - * @type {{ [key: string]: string; }} + * @type {Record} * @memberof AdditionalPropertiesClass */ - mapProperty?: { [key: string]: string; }; + mapProperty?: Record; /** * - * @type {{ [key: string]: { [key: string]: string; }; }} + * @type {Record>} * @memberof AdditionalPropertiesClass */ - mapOfMapProperty?: { [key: string]: { [key: string]: string; }; }; + mapOfMapProperty?: Record>; } /** diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FakeBigDecimalMap200Response.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FakeBigDecimalMap200Response.ts index 54458419a514..d3531e3a33a2 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FakeBigDecimalMap200Response.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/FakeBigDecimalMap200Response.ts @@ -27,10 +27,10 @@ export interface FakeBigDecimalMap200Response { someId?: number; /** * - * @type {{ [key: string]: number; }} + * @type {Record} * @memberof FakeBigDecimalMap200Response */ - someMap?: { [key: string]: number; }; + someMap?: Record; } /** diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MapTest.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MapTest.ts index 753c30a6cf93..e97a7f3ff160 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MapTest.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MapTest.ts @@ -21,28 +21,28 @@ import { mapValues } from '../runtime'; export interface MapTest { /** * - * @type {{ [key: string]: { [key: string]: string; }; }} + * @type {Record>} * @memberof MapTest */ - mapMapOfString?: { [key: string]: { [key: string]: string; }; }; + mapMapOfString?: Record>; /** * - * @type {{ [key: string]: string; }} + * @type {Record} * @memberof MapTest */ - mapOfEnumString?: { [key: string]: string; }; + mapOfEnumString?: Record; /** * - * @type {{ [key: string]: boolean; }} + * @type {Record} * @memberof MapTest */ - directMap?: { [key: string]: boolean; }; + directMap?: Record; /** * - * @type {{ [key: string]: boolean; }} + * @type {Record} * @memberof MapTest */ - indirectMap?: { [key: string]: boolean; }; + indirectMap?: Record; } diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MixedPropertiesAndAdditionalPropertiesClass.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MixedPropertiesAndAdditionalPropertiesClass.ts index 9263d67cc6f5..f06fa5ec7221 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MixedPropertiesAndAdditionalPropertiesClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/MixedPropertiesAndAdditionalPropertiesClass.ts @@ -41,10 +41,10 @@ export interface MixedPropertiesAndAdditionalPropertiesClass { dateTime?: Date; /** * - * @type {{ [key: string]: Animal; }} + * @type {Record} * @memberof MixedPropertiesAndAdditionalPropertiesClass */ - map?: { [key: string]: Animal; }; + map?: Record; } /** diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/NullableClass.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/NullableClass.ts index 11b2fb30dae8..f37903445742 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/NullableClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/NullableClass.ts @@ -76,22 +76,22 @@ export interface NullableClass { arrayItemsNullable?: Array; /** * - * @type {{ [key: string]: object; }} + * @type {Record} * @memberof NullableClass */ - objectNullableProp?: { [key: string]: object; } | null; + objectNullableProp?: Record | null; /** * - * @type {{ [key: string]: object | null; }} + * @type {Record} * @memberof NullableClass */ - objectAndItemsNullableProp?: { [key: string]: object | null; } | null; + objectAndItemsNullableProp?: Record | null; /** * - * @type {{ [key: string]: object | null; }} + * @type {Record} * @memberof NullableClass */ - objectItemsNullable?: { [key: string]: object | null; }; + objectItemsNullable?: Record; } /** diff --git a/samples/client/petstore/typescript-fetch/builds/default/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/default/apis/StoreApi.ts index 0bcfdbf84600..0005774cbea2 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/apis/StoreApi.ts @@ -81,7 +81,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; @@ -107,7 +107,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: number; }> { + async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.getInventoryRaw(initOverrides); return await response.value(); } diff --git a/samples/client/petstore/typescript-fetch/builds/default/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/default/docs/StoreApi.md index ceb7e08b016e..559fc12f4577 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/docs/StoreApi.md +++ b/samples/client/petstore/typescript-fetch/builds/default/docs/StoreApi.md @@ -81,7 +81,7 @@ No authorization required ## getInventory -> { [key: string]: number; } getInventory() +> Record<string, number> getInventory() Returns pet inventories by status @@ -122,7 +122,7 @@ This endpoint does not need any parameter. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/StoreApi.md index fea668fdac48..c337e0c547a2 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/docs/StoreApi.md +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/docs/StoreApi.md @@ -81,7 +81,7 @@ No authorization required ## getInventory -> { [key: string]: number; } getInventory() +> Record<string, number> getInventory() Returns pet inventories by status @@ -122,7 +122,7 @@ This endpoint does not need any parameter. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/StoreApi.ts index 0bcfdbf84600..0005774cbea2 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/StoreApi.ts @@ -81,7 +81,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; @@ -107,7 +107,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: number; }> { + async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.getInventoryRaw(initOverrides); return await response.value(); } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/StoreApi.ts index b3a1f18a31ce..2ec2ce06702c 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/StoreApi.ts @@ -81,7 +81,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; @@ -107,7 +107,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: number; }> { + async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.getInventoryRaw(initOverrides); return await response.value(); } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/StoreApi.md index ceb7e08b016e..559fc12f4577 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/StoreApi.md +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/docs/StoreApi.md @@ -81,7 +81,7 @@ No authorization required ## getInventory -> { [key: string]: number; } getInventory() +> Record<string, number> getInventory() Returns pet inventories by status @@ -122,7 +122,7 @@ This endpoint does not need any parameter. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/StoreApi.md index fea668fdac48..c337e0c547a2 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/StoreApi.md +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/docs/StoreApi.md @@ -81,7 +81,7 @@ No authorization required ## getInventory -> { [key: string]: number; } getInventory() +> Record<string, number> getInventory() Returns pet inventories by status @@ -122,7 +122,7 @@ This endpoint does not need any parameter. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/StoreApi.ts index c0a916bebe98..d32250a9466f 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/apis/StoreApi.ts @@ -81,7 +81,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; @@ -107,7 +107,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: number; }> { + async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.getInventoryRaw(initOverrides); return await response.value(); } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetBehaviorPermissionsResponse.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetBehaviorPermissionsResponse.md index 5deb6c64e11d..ba5bfd9802f4 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetBehaviorPermissionsResponse.md +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/GetBehaviorPermissionsResponse.md @@ -7,7 +7,7 @@ Name | Type ------------ | ------------- `meta` | [ResponseMeta](ResponseMeta.md) -`data` | { [key: string]: boolean; } +`data` | Record<string, boolean> ## Example diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/StoreApi.md index fea668fdac48..c337e0c547a2 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/StoreApi.md +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/docs/StoreApi.md @@ -81,7 +81,7 @@ No authorization required ## getInventory -> { [key: string]: number; } getInventory() +> Record<string, number> getInventory() Returns pet inventories by status @@ -122,7 +122,7 @@ This endpoint does not need any parameter. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/BehaviorApiSagas.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/BehaviorApiSagas.ts index 14b123ff5450..e38755a7f784 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/BehaviorApiSagas.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/BehaviorApiSagas.ts @@ -51,7 +51,7 @@ export interface PayloadGetBehaviorPermissionsRequest { } export const getBehaviorPermissionsRequest = createSagaAction("getBehaviorPermissionsRequest"); -export const getBehaviorPermissionsSuccess = createSagaAction<{ [key: string]: boolean; }>("getBehaviorPermissionsSuccess"); +export const getBehaviorPermissionsSuccess = createSagaAction>("getBehaviorPermissionsSuccess"); export const getBehaviorPermissionsFailure = createSagaAction<{error: any, requestPayload: PayloadGetBehaviorPermissions}>("getBehaviorPermissionsFailure"); export const getBehaviorPermissions = createSagaAction("getBehaviorPermissions"); diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/StoreApi.ts index b3a1f18a31ce..2ec2ce06702c 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/StoreApi.ts @@ -81,7 +81,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; @@ -107,7 +107,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: number; }> { + async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.getInventoryRaw(initOverrides); return await response.value(); } diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/StoreApiSagas.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/StoreApiSagas.ts index ba4a4e32e8fa..4fee870f4990 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/StoreApiSagas.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/apis/StoreApiSagas.ts @@ -88,7 +88,7 @@ export interface PayloadGetInventory extends BasePayloadApiAction { export const getInventoryRequest = createSagaAction("getInventoryRequest"); -export const getInventorySuccess = createSagaAction<{ [key: string]: number; }>("getInventorySuccess"); +export const getInventorySuccess = createSagaAction>("getInventorySuccess"); export const getInventoryFailure = createSagaAction<{error: any, requestPayload: PayloadGetInventory}>("getInventoryFailure"); export const getInventory = createSagaAction("getInventory"); @@ -103,7 +103,7 @@ export function *getInventorySagaImp(_action_: Action) { yield put(getInventoryRequest()); - const response: Required<{ [key: string]: number; }> = yield apiCall(Api.storeApi, Api.storeApi['getInventory'], + const response: Required> = yield apiCall(Api.storeApi, Api.storeApi['getInventory'], ); let successReturnValue: any = undefined; diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorPermissionsResponse.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorPermissionsResponse.ts index c8c229330602..c4b38ed9b5c3 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorPermissionsResponse.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorPermissionsResponse.ts @@ -35,10 +35,10 @@ export interface GetBehaviorPermissionsResponse { meta: ResponseMeta; /** * - * @type {{ [key: string]: boolean; }} + * @type {Record} * @memberof GetBehaviorPermissionsResponse */ - data?: { [key: string]: boolean; }; + data?: Record; } /** diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorPermissionsResponseRecord.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorPermissionsResponseRecord.ts index 1769f9ba5b39..676cfdd5224e 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorPermissionsResponseRecord.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/models/GetBehaviorPermissionsResponseRecord.ts @@ -34,7 +34,7 @@ import { export const GetBehaviorPermissionsResponseRecordProps = { recType: "GetBehaviorPermissionsResponseApiRecord" as "GetBehaviorPermissionsResponseApiRecord", meta: ResponseMetaRecord(), - data: null as { [key: string]: boolean; } | null, + data: null as Record | null, }; export type GetBehaviorPermissionsResponseRecordPropsType = typeof GetBehaviorPermissionsResponseRecordProps; @@ -57,7 +57,7 @@ class GetBehaviorPermissionsResponseRecordUtils extends ApiRecordUtils { return apiObject.data!; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/FakeApi.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/FakeApi.ts index 21ad0984b848..e6b8b1011354 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/FakeApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/FakeApi.ts @@ -128,7 +128,7 @@ export interface TestGroupParametersRequest { } export interface TestInlineAdditionalPropertiesRequest { - requestBody: { [key: string]: string; }; + requestBody: Record; } export interface TestJsonFormDataRequest { diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/StoreApi.ts index 3ba8c2cab723..b7bc68b897d6 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/apis/StoreApi.ts @@ -81,7 +81,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; @@ -107,7 +107,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: number; }> { + async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.getInventoryRaw(initOverrides); return await response.value(); } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/AdditionalPropertiesClass.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/AdditionalPropertiesClass.md index 57a49c2172f4..503ca5a70721 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/AdditionalPropertiesClass.md @@ -6,8 +6,8 @@ Name | Type ------------ | ------------- -`mapProperty` | { [key: string]: string; } -`mapOfMapProperty` | { [key: string]: { [key: string]: string; }; } +`mapProperty` | Record<string, string> +`mapOfMapProperty` | Record<string, Record<string, string>> ## Example diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeApi.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeApi.md index 4c05440de4b0..466095a7cd22 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeApi.md +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeApi.md @@ -1132,7 +1132,7 @@ async function example() { const api = new FakeApi(); const body = { - // { [key: string]: string; } | request body + // Record | request body requestBody: ..., } satisfies TestInlineAdditionalPropertiesRequest; @@ -1153,7 +1153,7 @@ example().catch(console.error); | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **requestBody** | `{ [key: string]: string; }` | request body | | +| **requestBody** | `Record` | request body | | ### Return type diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeBigDecimalMap200Response.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeBigDecimalMap200Response.md index 55decbceae7a..5da6b9fa4d09 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeBigDecimalMap200Response.md +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/FakeBigDecimalMap200Response.md @@ -7,7 +7,7 @@ Name | Type ------------ | ------------- `someId` | number -`someMap` | { [key: string]: number; } +`someMap` | Record<string, number> ## Example diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/MapTest.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/MapTest.md index dfb73cded89a..cceb87a38804 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/MapTest.md +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/MapTest.md @@ -6,10 +6,10 @@ Name | Type ------------ | ------------- -`mapMapOfString` | { [key: string]: { [key: string]: string; }; } -`mapOfEnumString` | { [key: string]: string; } -`directMap` | { [key: string]: boolean; } -`indirectMap` | { [key: string]: boolean; } +`mapMapOfString` | Record<string, Record<string, string>> +`mapOfEnumString` | Record<string, string> +`directMap` | Record<string, boolean> +`indirectMap` | Record<string, boolean> ## Example diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 7113d7669471..641bc577d74e 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -8,7 +8,7 @@ Name | Type ------------ | ------------- `uuid` | string `dateTime` | Date -`map` | [{ [key: string]: Animal; }](Animal.md) +`map` | [Record<string, Animal>](Animal.md) ## Example diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/NullableClass.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/NullableClass.md index 70d7011287c9..5f2e98f5acda 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/NullableClass.md +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/NullableClass.md @@ -15,9 +15,9 @@ Name | Type `arrayNullableProp` | Array<object> `arrayAndItemsNullableProp` | Array<object | null> `arrayItemsNullable` | Array<object | null> -`objectNullableProp` | { [key: string]: object; } -`objectAndItemsNullableProp` | { [key: string]: object | null; } -`objectItemsNullable` | { [key: string]: object | null; } +`objectNullableProp` | Record<string, object> +`objectAndItemsNullableProp` | Record<string, object | null> +`objectItemsNullable` | Record<string, object | null> ## Example diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/StoreApi.md index 9f6136a7714e..43cd31d94823 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/StoreApi.md +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/docs/StoreApi.md @@ -81,7 +81,7 @@ No authorization required ## getInventory -> { [key: string]: number; } getInventory() +> Record<string, number> getInventory() Returns pet inventories by status @@ -122,7 +122,7 @@ This endpoint does not need any parameter. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/AdditionalPropertiesClass.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/AdditionalPropertiesClass.ts index d470576ef7d3..662afa6a219b 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/AdditionalPropertiesClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/AdditionalPropertiesClass.ts @@ -21,16 +21,16 @@ import { mapValues } from '../runtime'; export interface AdditionalPropertiesClass { /** * - * @type {{ [key: string]: string; }} + * @type {Record} * @memberof AdditionalPropertiesClass */ - mapProperty?: { [key: string]: string; }; + mapProperty?: Record; /** * - * @type {{ [key: string]: { [key: string]: string; }; }} + * @type {Record>} * @memberof AdditionalPropertiesClass */ - mapOfMapProperty?: { [key: string]: { [key: string]: string; }; }; + mapOfMapProperty?: Record>; } /** diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FakeBigDecimalMap200Response.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FakeBigDecimalMap200Response.ts index 54458419a514..d3531e3a33a2 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FakeBigDecimalMap200Response.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/FakeBigDecimalMap200Response.ts @@ -27,10 +27,10 @@ export interface FakeBigDecimalMap200Response { someId?: number; /** * - * @type {{ [key: string]: number; }} + * @type {Record} * @memberof FakeBigDecimalMap200Response */ - someMap?: { [key: string]: number; }; + someMap?: Record; } /** diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MapTest.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MapTest.ts index 753c30a6cf93..e97a7f3ff160 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MapTest.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MapTest.ts @@ -21,28 +21,28 @@ import { mapValues } from '../runtime'; export interface MapTest { /** * - * @type {{ [key: string]: { [key: string]: string; }; }} + * @type {Record>} * @memberof MapTest */ - mapMapOfString?: { [key: string]: { [key: string]: string; }; }; + mapMapOfString?: Record>; /** * - * @type {{ [key: string]: string; }} + * @type {Record} * @memberof MapTest */ - mapOfEnumString?: { [key: string]: string; }; + mapOfEnumString?: Record; /** * - * @type {{ [key: string]: boolean; }} + * @type {Record} * @memberof MapTest */ - directMap?: { [key: string]: boolean; }; + directMap?: Record; /** * - * @type {{ [key: string]: boolean; }} + * @type {Record} * @memberof MapTest */ - indirectMap?: { [key: string]: boolean; }; + indirectMap?: Record; } diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MixedPropertiesAndAdditionalPropertiesClass.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MixedPropertiesAndAdditionalPropertiesClass.ts index 9263d67cc6f5..f06fa5ec7221 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MixedPropertiesAndAdditionalPropertiesClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/MixedPropertiesAndAdditionalPropertiesClass.ts @@ -41,10 +41,10 @@ export interface MixedPropertiesAndAdditionalPropertiesClass { dateTime?: Date; /** * - * @type {{ [key: string]: Animal; }} + * @type {Record} * @memberof MixedPropertiesAndAdditionalPropertiesClass */ - map?: { [key: string]: Animal; }; + map?: Record; } /** diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/NullableClass.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/NullableClass.ts index 11b2fb30dae8..f37903445742 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/NullableClass.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/NullableClass.ts @@ -76,22 +76,22 @@ export interface NullableClass { arrayItemsNullable?: Array; /** * - * @type {{ [key: string]: object; }} + * @type {Record} * @memberof NullableClass */ - objectNullableProp?: { [key: string]: object; } | null; + objectNullableProp?: Record | null; /** * - * @type {{ [key: string]: object | null; }} + * @type {Record} * @memberof NullableClass */ - objectAndItemsNullableProp?: { [key: string]: object | null; } | null; + objectAndItemsNullableProp?: Record | null; /** * - * @type {{ [key: string]: object | null; }} + * @type {Record} * @memberof NullableClass */ - objectItemsNullable?: { [key: string]: object | null; }; + objectItemsNullable?: Record; } /** diff --git a/samples/client/petstore/typescript-fetch/builds/validation-attributes/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/validation-attributes/apis/StoreApi.ts index 7f1528fdb2cb..a5a4cf629c5a 100644 --- a/samples/client/petstore/typescript-fetch/builds/validation-attributes/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/validation-attributes/apis/StoreApi.ts @@ -81,7 +81,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; @@ -107,7 +107,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: number; }> { + async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.getInventoryRaw(initOverrides); return await response.value(); } diff --git a/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/StoreApi.md index 379b8bb621ab..49c906b58baf 100644 --- a/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/StoreApi.md +++ b/samples/client/petstore/typescript-fetch/builds/validation-attributes/docs/StoreApi.md @@ -81,7 +81,7 @@ No authorization required ## getInventory -> { [key: string]: number; } getInventory() +> Record<string, number> getInventory() Returns pet inventories by status @@ -122,7 +122,7 @@ This endpoint does not need any parameter. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/StoreApi.ts index 770ac98198bc..8d7ee8f378fc 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/StoreApi.ts @@ -64,13 +64,13 @@ export interface StoreApiInterface { * @throws {RequiredError} * @memberof StoreApiInterface */ - getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>>; /** * Returns a map of status codes to quantities * Returns pet inventories by status */ - getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: number; }>; + getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions @@ -152,7 +152,7 @@ export class StoreApi extends runtime.BaseAPI implements StoreApiInterface { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; @@ -178,7 +178,7 @@ export class StoreApi extends runtime.BaseAPI implements StoreApiInterface { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: number; }> { + async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.getInventoryRaw(initOverrides); return await response.value(); } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/StoreApi.md index ceb7e08b016e..559fc12f4577 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/StoreApi.md +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/docs/StoreApi.md @@ -81,7 +81,7 @@ No authorization required ## getInventory -> { [key: string]: number; } getInventory() +> Record<string, number> getInventory() Returns pet inventories by status @@ -122,7 +122,7 @@ This endpoint does not need any parameter. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/StoreApi.md index fea668fdac48..c337e0c547a2 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/StoreApi.md +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/docs/StoreApi.md @@ -81,7 +81,7 @@ No authorization required ## getInventory -> { [key: string]: number; } getInventory() +> Record<string, number> getInventory() Returns pet inventories by status @@ -122,7 +122,7 @@ This endpoint does not need any parameter. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/StoreApi.ts index 0bcfdbf84600..0005774cbea2 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/StoreApi.ts @@ -81,7 +81,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; @@ -107,7 +107,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: number; }> { + async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.getInventoryRaw(initOverrides); return await response.value(); } diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/StoreApi.md index fea668fdac48..c337e0c547a2 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/StoreApi.md +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/docs/StoreApi.md @@ -81,7 +81,7 @@ No authorization required ## getInventory -> { [key: string]: number; } getInventory() +> Record<string, number> getInventory() Returns pet inventories by status @@ -122,7 +122,7 @@ This endpoint does not need any parameter. ### Return type -**{ [key: string]: number; }** +**Record** ### Authorization diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/apis/StoreApi.ts index e650674e0cdf..6a4df0fe3587 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/apis/StoreApi.ts @@ -77,7 +77,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; @@ -103,7 +103,7 @@ export class StoreApi extends runtime.BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: number; }> { + async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.getInventoryRaw(initOverrides); return await response.value(); } diff --git a/samples/client/petstore/typescript-inversify/api/store.service.ts b/samples/client/petstore/typescript-inversify/api/store.service.ts index 3b7211032906..4fb0d9af8456 100644 --- a/samples/client/petstore/typescript-inversify/api/store.service.ts +++ b/samples/client/petstore/typescript-inversify/api/store.service.ts @@ -66,8 +66,8 @@ export class StoreService { * Returns a map of status codes to quantities */ - public getInventory(observe?: 'body', headers?: Headers): Observable<{ [key: string]: number; }>; - public getInventory(observe?: 'response', headers?: Headers): Observable>; + public getInventory(observe?: 'body', headers?: Headers): Observable>; + public getInventory(observe?: 'response', headers?: Headers): Observable>>; public getInventory(observe: any = 'body', headers: Headers = {}): Observable { // authentication (api_key) required if (this.APIConfiguration.apiKeys && this.APIConfiguration.apiKeys['api_key']) { @@ -75,10 +75,10 @@ export class StoreService { } headers['Accept'] = 'application/json'; - const response: Observable> = this.httpClient.get(`${this.basePath}/store/inventory`, headers); + const response: Observable>> = this.httpClient.get(`${this.basePath}/store/inventory`, headers); if (observe === 'body') { return response.pipe( - map((httpResponse: HttpResponse) => <{ [key: string]: number; }>(httpResponse.response)) + map((httpResponse: HttpResponse) => >(httpResponse.response)) ); } return response; diff --git a/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts b/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts index 12daa011d6d0..00892b5308b6 100644 --- a/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts +++ b/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts @@ -112,7 +112,7 @@ export class StoreApi { * @summary Returns pet inventories by status */ public getInventory(extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: { [key: string]: number; }; }, + { response: JQueryXHR; body: Record; }, { response: JQueryXHR; errorThrown: string } > { let localVarPath = this.basePath + '/store/inventory'; @@ -156,11 +156,11 @@ export class StoreApi { } let dfd = $.Deferred< - { response: JQueryXHR; body: { [key: string]: number; }; }, + { response: JQueryXHR; body: Record; }, { response: JQueryXHR; errorThrown: string } >(); $.ajax(requestOptions).then( - (data: { [key: string]: number; }, textStatus: string, jqXHR: JQueryXHR) => + (data: Record, textStatus: string, jqXHR: JQueryXHR) => dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => dfd.reject({response: xhr, errorThrown: errorThrown}) diff --git a/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts b/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts index 12daa011d6d0..00892b5308b6 100644 --- a/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts +++ b/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts @@ -112,7 +112,7 @@ export class StoreApi { * @summary Returns pet inventories by status */ public getInventory(extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< - { response: JQueryXHR; body: { [key: string]: number; }; }, + { response: JQueryXHR; body: Record; }, { response: JQueryXHR; errorThrown: string } > { let localVarPath = this.basePath + '/store/inventory'; @@ -156,11 +156,11 @@ export class StoreApi { } let dfd = $.Deferred< - { response: JQueryXHR; body: { [key: string]: number; }; }, + { response: JQueryXHR; body: Record; }, { response: JQueryXHR; errorThrown: string } >(); $.ajax(requestOptions).then( - (data: { [key: string]: number; }, textStatus: string, jqXHR: JQueryXHR) => + (data: Record, textStatus: string, jqXHR: JQueryXHR) => dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => dfd.reject({response: xhr, errorThrown: errorThrown}) diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/store.service.ts index ddbcb72df5eb..9424640ebb87 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/store.service.ts @@ -94,7 +94,7 @@ export class StoreService { * @param reportProgress flag to report request and response progress. * @param {*} [getInventoryOpts.config] Override http request option. */ - public getInventory(getInventoryOpts?: { config?: AxiosRequestConfig }): Observable>; + public getInventory(getInventoryOpts?: { config?: AxiosRequestConfig }): Observable>>; public getInventory(getInventoryOpts?: { config?: AxiosRequestConfig }): Observable { let headers = {...this.defaultHeaders}; @@ -123,7 +123,7 @@ export class StoreService { headers['Authorization'] = `Bearer ${accessToken}`; } - return this.httpClient.get<{ [key: string]: number; }>(`${this.basePath}/store/inventory`, + return this.httpClient.get>(`${this.basePath}/store/inventory`, { withCredentials: this.configuration.withCredentials, ...getInventoryOpts?.config, diff --git a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/store.service.ts index b3a704627f30..e50ec782efd6 100644 --- a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/api/store.service.ts @@ -95,7 +95,7 @@ export class StoreService { * @param reportProgress flag to report request and response progress. * @param {*} [getInventoryOpts.config] Override http request option. */ - public getInventory(getInventoryOpts?: { config?: AxiosRequestConfig }): Observable>; + public getInventory(getInventoryOpts?: { config?: AxiosRequestConfig }): Observable>>; public getInventory(getInventoryOpts?: { config?: AxiosRequestConfig }): Observable { let headers = {...this.defaultHeaders}; @@ -124,7 +124,7 @@ export class StoreService { headers['Authorization'] = `Bearer ${accessToken}`; } - return this.httpClient.get<{ [key: string]: number; }>(`${this.basePath}/store/inventory`, + return this.httpClient.get>(`${this.basePath}/store/inventory`, { withCredentials: this.configuration.withCredentials, ...getInventoryOpts?.config, diff --git a/samples/client/petstore/typescript-node/default/api/storeApi.ts b/samples/client/petstore/typescript-node/default/api/storeApi.ts index f3f5b8ca651a..03a0e9a467b1 100644 --- a/samples/client/petstore/typescript-node/default/api/storeApi.ts +++ b/samples/client/petstore/typescript-node/default/api/storeApi.ts @@ -159,7 +159,7 @@ export class StoreApi { * Returns a map of status codes to quantities * @summary Returns pet inventories by status */ - public async getInventory (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: { [key: string]: number; }; }> { + public async getInventory (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Record; }> { const localVarPath = this.basePath + '/store/inventory'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); @@ -204,13 +204,13 @@ export class StoreApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: { [key: string]: number; }; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: Record; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "{ [key: string]: number; }"); + body = ObjectSerializer.deserialize(body, "Record"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); diff --git a/samples/client/petstore/typescript-node/npm/api/storeApi.ts b/samples/client/petstore/typescript-node/npm/api/storeApi.ts index f3f5b8ca651a..03a0e9a467b1 100644 --- a/samples/client/petstore/typescript-node/npm/api/storeApi.ts +++ b/samples/client/petstore/typescript-node/npm/api/storeApi.ts @@ -159,7 +159,7 @@ export class StoreApi { * Returns a map of status codes to quantities * @summary Returns pet inventories by status */ - public async getInventory (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: { [key: string]: number; }; }> { + public async getInventory (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Record; }> { const localVarPath = this.basePath + '/store/inventory'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); @@ -204,13 +204,13 @@ export class StoreApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.IncomingMessage; body: { [key: string]: number; }; }>((resolve, reject) => { + return new Promise<{ response: http.IncomingMessage; body: Record; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - body = ObjectSerializer.deserialize(body, "{ [key: string]: number; }"); + body = ObjectSerializer.deserialize(body, "Record"); resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); diff --git a/samples/client/petstore/typescript-redux-query/builds/with-npm-version/src/apis/StoreApi.ts b/samples/client/petstore/typescript-redux-query/builds/with-npm-version/src/apis/StoreApi.ts index ad509b371d49..48e4dd8b8620 100644 --- a/samples/client/petstore/typescript-redux-query/builds/with-npm-version/src/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-redux-query/builds/with-npm-version/src/apis/StoreApi.ts @@ -84,7 +84,7 @@ export function deleteOrder(requestParameters: DeleteOrderRequest, requestCon * Returns a map of status codes to quantities * Returns pet inventories by status */ -function getInventoryRaw( requestConfig: runtime.TypedQueryConfig = {}): QueryConfig { +function getInventoryRaw( requestConfig: runtime.TypedQueryConfig> = {}): QueryConfig { let queryParameters = null; @@ -120,7 +120,7 @@ function getInventoryRaw( requestConfig: runtime.TypedQueryConfig( requestConfig?: runtime.TypedQueryConfig): QueryConfig { +export function getInventory( requestConfig?: runtime.TypedQueryConfig>): QueryConfig { return getInventoryRaw( requestConfig); } diff --git a/samples/client/petstore/typescript-rxjs/builds/default/apis/StoreApi.ts b/samples/client/petstore/typescript-rxjs/builds/default/apis/StoreApi.ts index 85dcd9aa568a..290ddae215e4 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/apis/StoreApi.ts @@ -55,14 +55,14 @@ export class StoreApi extends BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - getInventory(): Observable<{ [key: string]: number; }> - getInventory(opts?: OperationOpts): Observable> - getInventory(opts?: OperationOpts): Observable<{ [key: string]: number; } | AjaxResponse<{ [key: string]: number; }>> { + getInventory(): Observable> + getInventory(opts?: OperationOpts): Observable>> + getInventory(opts?: OperationOpts): Observable | AjaxResponse>> { const headers: HttpHeaders = { ...(this.configuration.apiKey && { 'api_key': this.configuration.apiKey('api_key') }), // api_key authentication }; - return this.request<{ [key: string]: number; }>({ + return this.request>({ url: '/store/inventory', method: 'GET', headers, diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/StoreApi.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/StoreApi.ts index 85dcd9aa568a..290ddae215e4 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/StoreApi.ts @@ -55,14 +55,14 @@ export class StoreApi extends BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - getInventory(): Observable<{ [key: string]: number; }> - getInventory(opts?: OperationOpts): Observable> - getInventory(opts?: OperationOpts): Observable<{ [key: string]: number; } | AjaxResponse<{ [key: string]: number; }>> { + getInventory(): Observable> + getInventory(opts?: OperationOpts): Observable>> + getInventory(opts?: OperationOpts): Observable | AjaxResponse>> { const headers: HttpHeaders = { ...(this.configuration.apiKey && { 'api_key': this.configuration.apiKey('api_key') }), // api_key authentication }; - return this.request<{ [key: string]: number; }>({ + return this.request>({ url: '/store/inventory', method: 'GET', headers, diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/StoreApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/StoreApi.ts index 85dcd9aa568a..290ddae215e4 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/StoreApi.ts @@ -55,14 +55,14 @@ export class StoreApi extends BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - getInventory(): Observable<{ [key: string]: number; }> - getInventory(opts?: OperationOpts): Observable> - getInventory(opts?: OperationOpts): Observable<{ [key: string]: number; } | AjaxResponse<{ [key: string]: number; }>> { + getInventory(): Observable> + getInventory(opts?: OperationOpts): Observable>> + getInventory(opts?: OperationOpts): Observable | AjaxResponse>> { const headers: HttpHeaders = { ...(this.configuration.apiKey && { 'api_key': this.configuration.apiKey('api_key') }), // api_key authentication }; - return this.request<{ [key: string]: number; }>({ + return this.request>({ url: '/store/inventory', method: 'GET', headers, diff --git a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/apis/StoreApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/apis/StoreApi.ts index 7d1a2bf2ca47..76b150f7fade 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/apis/StoreApi.ts @@ -57,15 +57,15 @@ export class StoreApi extends BaseAPI { * Returns a map of status codes to quantities * Returns pet inventories by status */ - getInventory(): Observable<{ [key: string]: number; }> - getInventory(opts?: Pick): Observable<{ [key: string]: number; }> - getInventory(opts?: OperationOpts): Observable> - getInventory(opts?: OperationOpts): Observable<{ [key: string]: number; } | AjaxResponse<{ [key: string]: number; }>> { + getInventory(): Observable> + getInventory(opts?: Pick): Observable> + getInventory(opts?: OperationOpts): Observable>> + getInventory(opts?: OperationOpts): Observable | AjaxResponse>> { const headers: HttpHeaders = { ...(this.configuration.apiKey && { 'api_key': this.configuration.apiKey('api_key') }), // api_key authentication }; - return this.request<{ [key: string]: number; }>({ + return this.request>({ url: '/store/inventory', method: 'GET', headers, diff --git a/samples/server/petstore/typescript-nestjs-server/builds/default/api/StoreApi.ts b/samples/server/petstore/typescript-nestjs-server/builds/default/api/StoreApi.ts index 8d8f1e279375..25a2bd05a95b 100644 --- a/samples/server/petstore/typescript-nestjs-server/builds/default/api/StoreApi.ts +++ b/samples/server/petstore/typescript-nestjs-server/builds/default/api/StoreApi.ts @@ -9,7 +9,7 @@ export abstract class StoreApi { abstract deleteOrder(orderId: string, request: Request): void | Promise | Observable; - abstract getInventory( request: Request): { [key: string]: number; } | Promise<{ [key: string]: number; }> | Observable<{ [key: string]: number; }>; + abstract getInventory( request: Request): Record | Promise> | Observable>; abstract getOrderById(orderId: number, request: Request): Order | Promise | Observable; diff --git a/samples/server/petstore/typescript-nestjs-server/builds/default/controllers/StoreApi.controller.ts b/samples/server/petstore/typescript-nestjs-server/builds/default/controllers/StoreApi.controller.ts index f32cd6358dfd..844ca54b0a12 100644 --- a/samples/server/petstore/typescript-nestjs-server/builds/default/controllers/StoreApi.controller.ts +++ b/samples/server/petstore/typescript-nestjs-server/builds/default/controllers/StoreApi.controller.ts @@ -13,7 +13,7 @@ export class StoreApiController { } @Get('/store/inventory') - getInventory(@Req() request: Request): { [key: string]: number; } | Promise<{ [key: string]: number; }> | Observable<{ [key: string]: number; }> { + getInventory(@Req() request: Request): Record | Promise> | Observable> { return this.storeApi.getInventory(request); }