swagger-api / swagger-api/swagger-codegen
[KOTLIN] allOf doesn't generate $ref
Open
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
When generating with kotlin-client a class like this:
Cat:
allOf:
- $ref: '#/components/schemas/Pet'
- properties:
hunts:
type: boolean
age:
type: integer
ignores $ref and only generates attributes from properties
Swagger-codegen version
3.0.61
Related issues/PRs
Similar issue was raised before: https://github.com/swagger-api/swagger-codegen/issues/12241
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 by reproducing the issue with the supplied Cat schema using the kotlin-client generator, then trace the generator or template responsible for Kotlin allOf models. Compare the generated Cat with the expected Pet reference and local properties; done means the $ref is preserved alongside hunts and age.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin, openapi
- Domain
- backend-api-design, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100