swagger-parser
swagger-parser copied to clipboard
Support programmatic use cases
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
Any thoughts on this?