IBM/openapi-validator

Different reporting by npm vs command line tool

Closed this issue · 1 comments

By the command line tool following was reported as a single issue

 Message :   Error container model must contain property `errors` which must be an array of error models
  Path    :   components.schemas.ErrorResponse.properties
  Line    :   0

By then we run it through npm package, and wherever the ErrorResponse object was used, the issue was reported.

     {
             "path": [
                 "paths",
                 "/v1/mypathname",
                 "post",
                 "responses",
                 "404",
                 "content",
                 "*/*",
                 "schema",
                 "properties"
             ],
             "message": "Error container model must contain property `errors` which must be an array of error models",
             "rule": "response-error-response-schema"
         }

It does seem there are some issues with the Node module portion of the validator but I should note that we are currently planning on deprecating the Node module API and therefore, it is no longer being supported.

Our recommendation moving forward is to use Spectral's Node API and import our ruleset as a dependency to get consistent behavior with the CLI tool. That's what the CLI tool is doing behind the scenes.