We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I generate code for an enum object defined with integer type, JSDoc outputs @enum {string}.
@enum {string}
7.8.0
components: schemas: PetStatus: type: integer description: pet status in the store enum: - 1 - 2 - 3
schema.yml
openapi: 3.0.2 info: title: Sample version: 1.0.0 license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html servers: - url: /api paths: "/pets/{petId}": get: summary: Find pet by ID description: Returns a single pet operationId: getPetById parameters: - name: petId in: path description: ID of pet to return required: true schema: type: integer format: int64 responses: '200': description: successful operation content: application/json: schema: "$ref": "#/components/schemas/Pet" components: schemas: Pet: required: - id - name type: object properties: id: type: integer format: int64 example: 10 name: type: string example: doggie status: "$ref": "#/components/schemas/PetStatus" PetStatus: type: integer description: pet status in the store enum: - 1 - 2 - 3
/** * pet status in the store * @export * @enum {string} */ export const PetStatus = { NUMBER_1: 1, NUMBER_2: 2, NUMBER_3: 3 } as const;
expect
/** * pet status in the store * @export * @enum {number} */ export const PetStatus = { NUMBER_1: 1, NUMBER_2: 2, NUMBER_3: 3 } as const;
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g typescript-axios -i ./schema.yml -o ./var/tmp/typescript-axios
The text was updated successfully, but these errors were encountered:
[typescript-axios] fix: enum datatype jsdoc (#19570) (#19571)
ca378b4
* fix: enum dataType JSDoc * chore: generate samples
Successfully merging a pull request may close this issue.
Bug Report Checklist
Description
When I generate code for an enum object defined with integer type, JSDoc outputs
@enum {string}
.openapi-generator version
7.8.0
OpenAPI declaration file content or url
full schema
schema.yml
Generation Details
expect
Steps to reproduce
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g typescript-axios -i ./schema.yml -o ./var/tmp/typescript-axios
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered: