forked from loafle/openapi-generator-original
[Typescript] support schemaMapping (#12803)
Co-authored-by: hansnuttin <hans.nuttin@aca-it.be>
This commit is contained in:
parent
244a459836
commit
073a800464
@ -430,11 +430,11 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
|
|||||||
public String getTypeDeclaration(Schema p) {
|
public String getTypeDeclaration(Schema p) {
|
||||||
if (ModelUtils.isArraySchema(p)) {
|
if (ModelUtils.isArraySchema(p)) {
|
||||||
Schema<?> items = getSchemaItems((ArraySchema) p);
|
Schema<?> items = getSchemaItems((ArraySchema) p);
|
||||||
return getSchemaType(p) + "<" + getTypeDeclaration(ModelUtils.unaliasSchema(this.openAPI, items)) + ">";
|
return getSchemaType(p) + "<" + getTypeDeclaration(ModelUtils.unaliasSchema(this.openAPI, items, schemaMapping)) + ">";
|
||||||
} else if (ModelUtils.isMapSchema(p)) {
|
} else if (ModelUtils.isMapSchema(p)) {
|
||||||
Schema<?> inner = getSchemaAdditionalProperties(p);
|
Schema<?> inner = getSchemaAdditionalProperties(p);
|
||||||
String nullSafeSuffix = getNullSafeAdditionalProps() ? " | undefined" : "";
|
String nullSafeSuffix = getNullSafeAdditionalProps() ? " | undefined" : "";
|
||||||
return "{ [key: string]: " + getTypeDeclaration(ModelUtils.unaliasSchema(this.openAPI, inner)) + nullSafeSuffix + "; }";
|
return "{ [key: string]: " + getTypeDeclaration(ModelUtils.unaliasSchema(this.openAPI, inner, schemaMapping)) + nullSafeSuffix + "; }";
|
||||||
} else if (ModelUtils.isFileSchema(p)) {
|
} else if (ModelUtils.isFileSchema(p)) {
|
||||||
return "any";
|
return "any";
|
||||||
} else if (ModelUtils.isBinarySchema(p)) {
|
} else if (ModelUtils.isBinarySchema(p)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user