swagger-api / swagger-api/swagger-codegen
Codegen does not generate generic List
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
In my api model I have:
@JsonProperty("repriceItems") private List<RepriceItem> items;
swagger json (I think correct):
"repriceItems": { "items": { "type": "RepriceItem" }, "required": false, "type": "List" }
But when I run codegen for Java or Android, I get:
private List repriceItems = null;
instead of
private List<RepriceItem> repriceItems = null;
I'm using codegen v 2.1.2-M1.
Is it a bug or do I something wrong?
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
Reproduce the Java and Android codegen output from the supplied model and Swagger JSON using codegen v2.1.2-M1. Start by tracing the Java/Android type handling and templates that produce the repriceItems field, then verify the generated declaration preserves RepriceItem and add or update regression coverage if the project provides it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100