Skip to content

OpenAPI schema invalid? #24

@multimeric

Description

@multimeric

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);
    })

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