Adds a validation parameter to CodegenConfigurator, and passes through options from CLI, Maven Plugin and Gradle Plugin to that property.
Default is to validate the spec during generation. If spec has errors, we will output errors as well as warnings to the user.
Option can be disabled by passing false to skipValidateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
This was brought up in #208 (closed). We want to validate the spec on generation to prevent OpenAPI Spec 3.x options from creeping into OpenAPI Spec 2.0 support. I would also consider this a bug fix, because as a user I would be surprised to find that generation succeeds when my spec is invalid by default.
PR checklist
-
Read the contribution guidelines. -
Ran the shell script under ./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
. -
Filed the PR against the correct branch: Default: master
. -
Copied the technical committee to review the pull request if your PR is targeting a particular programming language.