swagger-api / swagger-api/swagger-codegen
Type problem on enum generating jaxrs-cxf-cdi-server
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Q&A (please complete the following information)
- OS: all
- Browser: all
- Version: all
- Swagger-Editor version: 3.23.9
- Swagger/OpenAPI version: Swagger 2.0, OpenAPI 3.0
Content & configuration
If you define a enum with type integer and format int32 an generat jaxrs-cxf-cdi server, the generated model has a type problem. the enum is handled like a string type enum. It is correct if you generate a jaxrs-cxf server from the definition
Example Swagger/OpenAPI definition:
enumproperty:
type: integer
format: int32
enum:
- 1
default: 1
Describe the bug you're encountering
To reproduce...
Steps to reproduce the behavior:
- Go to 'editor.swagger.io'
- Create a basic definition with a enum with type integer and format int32
- Click on 'Generate Server' -> jaxrs-cxf-cdi
- Check the generated model in an IDE
Expected behavior
Correct type on Enum in the generated model.
Screenshots
Generated jaxrs-cxf-cdi-server

Genereated jaxrs-cxf-server

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 by reproducing the integer, int32 enum through jaxrs-cxf-cdi server generation and compare its generated model with the jaxrs-cxf output. Trace the generator entry point and templates involved in enum handling; done means the generated jaxrs-cxf-cdi model uses the correct integer enum type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100