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

swagger.json validation errors #234

Open
2 tasks
cmcclellan1970 opened this issue Jun 25, 2022 · 0 comments
Open
2 tasks

swagger.json validation errors #234

cmcclellan1970 opened this issue Jun 25, 2022 · 0 comments

Comments

@cmcclellan1970
Copy link

Description

I'm using Insomnia to import the swagger.json for the API (I copied it from the repo). There are many validation errors, but generally easy to fix. I fixed them in my local Insomnia project - here is what I found:

  1. "version" property (required) missing from "info" definition at the top of the document. (what is the current version anyway?)

  2. many instances of this error: "$ref": "#/components/schemas/ID" does not exist. In fact, if you go to the swagger UI page of the live API you can see this for yourself if you try to invoke the first method under the default category: GET /rest/capsule/{id}. I replaced all occurrences of "$ref": "#/components/schemas/ID" with "type":"string". This seems to work (at least it works if I pass a string to the /rest/capsule/{id} method referenced above. Not sure if ID should be added to components/schemas as simply a string type or something more complex.

  3. many instances of this error: oas3-schema "200" property must have required property description. These are in the responses collection for each path. I simply added a description for each that stated what the return type was.

  4. many instances if this error: oas3-schema "required" property must not have fewer than 1 items. These are empty arrays in the schema, i.e. "required":[]. I simply removed all references to this property, where the array was empty.

To Reproduce

I suspect many tools will reveal these issues, for Insomnia, click on New Document, name the document, and choose "Import File" from the document workspace. Pick the swagger.json file from this project.

(See above)

Expected behavior

A clear and concise description of what you expected to happen.

Additional context

Add any other context about the problem here.

Reproducible Demo

Let us know how to reproduce the issue. Include a code sample, share a project, or share an use case that reproduces the issue using https://codesandbox.io/s/github/spacexland/api.

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

1 participant