swagger-api / swagger-api/swagger-parser
Support programmatic use cases
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 867
- Forks
- 560
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
Description
We run Swagger codegen in our builds, programmatically, from a custom Gradle plugin that calls SwaggerCodegen.main, passing String[] args as if we're sitting there in front of a command line typing.
This doesn't seem to be an expected use case, because messages are accumulated by the parser, and reported by the parser, but it doesn't throw an exception at the end.
We tried replacing the logger with one that would capture, but some kind of conflict between Gradle and logback prevented that (unable to cast listener).
We would very much like to be able to pass a flag into the parser that would cause it to throw if there are messages. It could wait until the end, in order to collect as many errors as possible before failing.
Related: https://github.com/swagger-api/swagger-parser/issues/1396
Related: https://github.com/swagger-api/swagger-ui/issues/2418
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 at SwaggerCodegen.main and trace how parser messages are accumulated and reported during programmatic invocation. Define the parser flag's behavior, including collecting messages before failing, and verify it with coverage for String[] argument use from a build plugin.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100