Improve messages of "validate" result
Created by: ackintosh
Description
$ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar validate -i test-petstore.yaml
Validating spec file (test-petstore.yaml)
attribute paths.'/pet/findByStatus'(get).responses is missing
attribute paths.'/pet/{petId}'(get).parameter is unexpected
attribute paths.'/pet'.pu is unexpected
attribute paths.'/pet'(post).responses is missing
Exception in thread "main" org.openapitools.codegen.cmd.ValidateException
at org.openapitools.codegen.cmd.Validate.run(Validate.java:50)
at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:56)
Exception in thread "main"....
seems like something wrong in validation command, but this is the correct behavior in the case of validation errors. It is confusing.
openapi-generator version
current master
Suggest a fix/enhancement
- validation error (with exit code 1)
$ cli validate -i https......
Validating spec file (test-petstore.yaml)
- attribute paths.'/pet/findByStatus'(get).responses is missing
- attribute paths.'/pet/{petId}'(get).parameter is unexpected
- attribute paths.'/pet'.pu is unexpected
- attribute paths.'/pet'(post).responses is missing
$
- no errors (with exit code 0)
$ cli validate -i https......
Validating spec file (test-petstore.yaml)
No validate errors detected.
$