Skip to content

swagger.json validation errors #234

@cmcclellan1970

Description

@cmcclellan1970

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions