swagger-api / swagger-api/swagger-codegen
Composed body parameter causes null pointer exception
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Defining an api operation with composite parameter causes a ComposedModel to be generated. The swagger-codegen then does not handle that type in class DefaultCodegen function fromParameter.
Resulting in a null pointer exception.
Swagger-codegen version
2.2.2-SNAPSHOT
Swagger declaration file content or url
Use Animal object from the swagger spec as body object in the operation.
Command line used for generation
java -jar swagger-codegen/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -l jaxrs-cxf - -i api.json
Steps to reproduce
Related issues
Suggest a Fix
Implement composite support for body parameter
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 in DefaultCodegen.fromParameter and reproduce the failure with the Animal object in api.json using the jaxrs-cxf command shown. Trace how the generated ComposedModel is handled as a body parameter; done means generation completes without a null pointer exception and composite body parameters are supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100