swagger-api / swagger-api/swagger-codegen

[KOTLIN] allOf doesn't generate $ref

Open
#12,446 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.