swagger-api / swagger-api/swagger-codegen
[Javascript] codegen produces broken models for types inherited from primitive
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Javascript codegen produces broken models (not using data at all) for types inherited from primitive types like the following.
Swagger-codegen version
Tested with 2.4.1 and 2.3.1, not a regression
Swagger declaration file content or url
ResourceId:
description: Identifier assigned for further use of the created resource through API calls
type: string
pattern: '^([a-zA-Z0-9 /\-?:\()\.,'']{1,35})$'
readOnly: true
Related issues/PRs
https://github.com/swagger-api/swagger-codegen/pull/9112
Suggest a fix/enhancement
Checking if parent type is primitive
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
Read the JavaScript codegen handling for models inherited from primitive types, then compare the behavior with related PR #9112 and the provided ResourceId Swagger declaration. Done means generated models for primitive-derived types use the declared data instead of producing broken empty models.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100