mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-05 23:20:52 +00:00
add schema mapping support in typescript client codegen (#12840)
This commit is contained in:
parent
4bbfa01ba8
commit
00db9255c0
@ -885,10 +885,10 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo
|
|||||||
Schema inner;
|
Schema inner;
|
||||||
if (ModelUtils.isArraySchema(p)) {
|
if (ModelUtils.isArraySchema(p)) {
|
||||||
inner = ((ArraySchema) p).getItems();
|
inner = ((ArraySchema) p).getItems();
|
||||||
return this.getSchemaType(p) + "<" + this.getTypeDeclaration(ModelUtils.unaliasSchema(this.openAPI, inner)) + ">";
|
return this.getSchemaType(p) + "<" + this.getTypeDeclaration(ModelUtils.unaliasSchema(this.openAPI, inner, schemaMapping)) + ">";
|
||||||
} else if (ModelUtils.isMapSchema(p)) {
|
} else if (ModelUtils.isMapSchema(p)) {
|
||||||
inner = (Schema) p.getAdditionalProperties();
|
inner = (Schema) p.getAdditionalProperties();
|
||||||
return "{ [key: string]: " + this.getTypeDeclaration(ModelUtils.unaliasSchema(this.openAPI, inner)) + "; }";
|
return "{ [key: string]: " + this.getTypeDeclaration(ModelUtils.unaliasSchema(this.openAPI, inner, schemaMapping)) + "; }";
|
||||||
} else if (ModelUtils.isFileSchema(p)) {
|
} else if (ModelUtils.isFileSchema(p)) {
|
||||||
return "HttpFile";
|
return "HttpFile";
|
||||||
} else if (ModelUtils.isBinarySchema(p)) {
|
} else if (ModelUtils.isBinarySchema(p)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user