OpenAPITools / OpenAPITools/openapi-generator
[BUG] [Javascript] When creating a Enum in a Query Path, it is being generated as model/String and cant be used.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
I have an enum in my path which can be of the values "CLUB" or "EVENT". Definition:
parameters:
ClubElementType:
name: ClubElementType
in: path
required: true
schema:
type: string
enum:
- CLUB
- EVENT
description: The type of Element to handle.
When used in a api function, it gets defined as this type:
@param {module:model/String} clubElementType The type of Element to handle.
Which is obviously wrong, since there is no class "model/String".
openapi-generator version
6.4.0
OpenAPI declaration file content or url
parameters:
ClubElementType:
name: ClubElementType
in: path
required: true
schema:
type: string
enum:
- CLUB
- EVENT
description: The type of Element to handle.
Generation Details
just use the "javascript" generator.
Steps to reproduce
create a schema with an string enum and use it in a method. Works also inline.
Related issues/PRs
nothing found
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the JavaScript generator and reproduce the issue using the inline string enum in the supplied OpenAPI parameter definition. Trace how the path parameter type is rendered in the generated API method documentation; done means the enum is represented as a usable JavaScript type rather than module:model/String.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, openapi
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100