swagger-api / swagger-api/swagger-codegen
[JAVA] Useless error message when invalid combination of options are set
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
When setting certain options that are incompatible with each other, code gen brings up a useless error message that offers no help in fixing the problem
Swagger-codegen version
Swagger 2.0, OpenAPI 3.0
Swagger declaration file content or url
(use default petstore demo .yaml file.)
Command line used for generation
In the editor at app.swaggerhub.com, go to the Export menu and choose Server Stub: spring
Steps to reproduce
- Use the standard Swagger Petstore yaml file.
- Go to Export:CodeGen Options, choose Spring, and set the following options:
InterfaceOnly
DelegatePattern - Go to Export: Server-Stub, and choose Spring. This will pop up this error message:
There was an error generating the servers spring code. Please ensure that the definition and all external refs (inc. domains) are valid.
This is a useless error message. It implies the problem is with the .yaml file, when the problem is actually with incompatible options. Please provide a better error message, that tells which options are not compatible.
Suggest a fix/enhancement
provide an error message saying "InterfaceOnly and DelegatePattern options are incompatible with each other."
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 failure with the standard Petstore YAML, the Spring server target, and the InterfaceOnly and DelegatePattern options enabled. Start by tracing Spring server generation and option validation; done means the incompatible options are identified in the error instead of producing a misleading definition or external-reference message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100