Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #167
Closed
Open
Issue created May 28, 2018 by Administrator@rootContributor

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. 😕 ref: Validate.java#L50

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.
$ 
Assignee
Assign to
Time tracking