swagger-api / swagger-api/swagger-codegen

Incorrect models generated when allOf tag is used

Open
#7,946 0 comments 4 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

Models defined with nested models using the allOf tag are not generated correctly.

Swagger-codegen version

2.3.1

Swagger declaration file content or url

gist here

Command line used for generation

http://editor.swagger.io

Steps to reproduce
  1. Paste gist contents into editor.swagger.io
  2. Click generate server
  3. Open pet model file in downloaded project
  4. Note missing category and tag properties

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

Reproduce the issue by pasting the linked gist into editor.swagger.io, generating a server, and inspecting the downloaded pet model file. Compare the generated model with the nested allOf definition; done means the category and tag properties are present.

Written by the indexing model from the issue text.

Assessment

Domain
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.