Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openapi-cli validate just crashes during validation #127

Closed
Ark-kun opened this issue May 5, 2020 · 4 comments
Closed

openapi-cli validate just crashes during validation #127

Ark-kun opened this issue May 5, 2020 · 4 comments

Comments

@Ark-kun
Copy link

Ark-kun commented May 5, 2020

$ npx @redocly/openapi-cli validate https://raw.githubusercontent.com/Ark-kun/pipelines/ba5aede77e5745922a714ec60920dc504197a8b3/sdk/python/kfp/components/structures/components.json_schema.json
npx: installed 73 in 5.813s
Will validate from URL
(node:249586) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'path' of undefined
    at Object.onEnter (/usr/local/home/foo/.npm/_npx/249586/lib/node_modules/@redocly/openapi-cli/dist/visitors/rules/structural/noRefSiblings.js:25:35)
    at runRuleOnRuleset (/usr/local/home/foo/.npm/_npx/249586/lib/node_modules/@redocly/openapi-cli/dist/traverse.js:166:137)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:249586) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:249586) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@adamaltman
Copy link
Member

We should give a nicer error message instead of crashing.

From what I can tell when I look at the file it is not an OAS2 or OAS3 definition.

  "$schema": "http://json-schema.org/draft-06/schema#",

Maybe there is some demand for JSON Schema validation. There are also many different versions of JSON Schema. OAS3.0:

Models are defined using the Schema Object, which is an extended subset of JSON Schema Specification Wright Draft 00.

Action items

@Ark-kun
Copy link
Author

Ark-kun commented May 19, 2020

From what I can tell when I look at the file it is not an OAS2 or OAS3 definition.

Oh, I see my mistake. I got pointed to Redocly by one of my peer saying "it would be easier to see your schema if it was shown as this Redocly example" and I just went on without thinking that while OAS3 uses JsonSchema to describe parameters, OAS is not the same as JsonScheama (has-a vs. is-a).

Generally, it would be nice to be able to visualize object schema not just as part of routes.

@adamaltman
Copy link
Member

It is possible to visualize the object schema not as routes, but in our case, only if it is part of the OAS document.

@adamaltman
Copy link
Member

I'm closing this issue. 1.0.0-beta.1 solves the error message part of the issue.

Something went wrong when processing https://raw.githubusercontent.com/Ark-kun/pipelines/ba5aede77e5745922a714ec60920dc504197a8b3/sdk/python/kfp/components/structures/components.json_schema.json:

  - Unsupported OpenAPI Version: undefined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants