swagger-api / swagger-api/swagger-codegen

Java SDK - Generating models that are defined with “allOf” is implemented only for “definitions” but not for “responses”

Open
#4,146 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature: Composition / Inheritance Issue: Bug
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

I am trying to generate a JAVA SDK from swagger codegen and realised that when I use the “responses” property in the swagger file to define responses models,
the models that are defined using “allOf” are not generated in the SDK under "Models" folder.
(When defining models using “allOf” in “definitions” property the models are generated in the SDK under "Models" folder)

Could it be that generating models that are defined with “allOf” is implemented only for “definitions” and not for “responses”?

Swagger-codegen version

2.2.2-SNAPSHOT

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 Java SDK generation described in the issue with models using allOf under both definitions and responses. Compare the generated Models output and trace the Swagger Codegen path that processes response schemas; done means equivalent allOf models are generated for responses as they are for definitions.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.