-
Notifications
You must be signed in to change notification settings - Fork 6k
Open
Description
Description
I am using the typescript-axios preset to generate the API client. The generated code is using HTML escaping which is causing certain type annotations, particularly ones which use special characters, to not get recognized by Typescript in my client codebase.
Below is what the outputted client code looks like:
export interface ServerpbInvoice {
/**
* @inject_tag: validate:\"required\"
* @type {Array<ServerpbInvoiceItems>}
* @memberof ServerpbInvoice
*/
items: any;
...
}
Swagger-codegen version
3.0.23
Swagger declaration file content or url
{
...
"definitions": {
"serverpb.Invoice": {
"type": "object",
"required": [
...
],
"properties": {
...
"items": {
"description": "@inject_tag: validate:\"required\"",
"type": "array",
"items": {
"$ref": "#/definitions/serverpb.InvoiceItems"
}
},
}
}
}
...
}
Command line used for generation
swagger-codegen generate -i docs/swagger.json -l typescript-axios -o ./generated
Steps to reproduce
- Run the command described above to generate an API client
- Reference a property with escaped special characters in the type annotation
- Run the Typescript compiler
Related issues/PRs
I could not find any.
hitendramalviya, cole-floodbase and mandyMooreFan
Metadata
Metadata
Assignees
Labels
No labels