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 schema invalid? #24

Open
multimeric opened this issue Jul 28, 2020 · 0 comments
Open

OpenAPI schema invalid? #24

multimeric opened this issue Jul 28, 2020 · 0 comments

Comments

@multimeric
Copy link

I've encountered a number of errors when trying to use the OpenAPI spec to create a client and then generate some requests. I think these errors are in the spec and also in the response sometimes not matching the spec. At the very least, I have identified this schema issue:

Error: One or more errors exist in the OpenApi definition
  at: components > schemas > Tool > properties
    at: contains
      Missing required property: items
    at: identifiers
      Missing required property: items

I've made a simple validation script for Node, that uses openapi-enforcer (run npm install openapi-enforcer beforehand), which produces the above output. I'll run it again if the API spec gets fixed in order to check if the responses are valid, but currently it's getting stuck at the invalid spec.

const Enforcer = require('openapi-enforcer')

Enforcer('https://api.biocontainers.pro/ga4gh/trs/v2/openapi.json', { fullResult: true })
    .then(({error, value}) => {
        if (error){
            throw new Error(error);
        } else {
            return value.request({
              method: 'get',
              path: '/ga4gh/trs/v2/tools?toolClass=Docker&limit=1000&sort_field=id&sort_order=asc',
            })
        }
    }).then(({error, value}) => {
        if (error){
            throw new Error(error);
        } else {
            console.log(value);
        }
    }).catch(error => {
        console.log(error);
    })
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