Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

"Error: There is no schema in the input contents." openapi v3 only #53

Description

@paxperscientiam

Hello @mstssk ,

I'm trying to use your wrapper; however, it's erroring out when I try to use it to consume OpenAPI files of version 3.
I used this one: https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml

Here is the error:

Error: There is no schema in the input contents.
at SchemaConvertor.buildSchemaMergedMap (/private/tmp/sd/node_modules/dtsgenerator/dist/core/schemaConvertor.js:68:19)
at DtsGenerator. (/private/tmp/sd/node_modules/dtsgenerator/dist/core/dtsGenerator.js:25:46)
at step (/private/tmp/sd/node_modules/tslib/tslib.js:136:27)
at Object.next (/private/tmp/sd/node_modules/tslib/tslib.js:117:57)
at fulfilled (/private/tmp/sd/node_modules/tslib/tslib.js:107:62)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
at startup (internal/bootstrap/node.js:279:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:696:3)

EDIT:
OK, so it kinda works if the -w flag is used. However, even then, the result is incomplete: many paths are missing from the result.

For example, here's a version 3 example from US National Weather Service: https://api.weather.gov/openapi.json

export interface Alerts {
    active?: any;
    start?: any;
    end?: any;
    status?: any;
    message_type?: any;
    event?: any;
    code?: any;
    region_type?: any;
    point?: any;
    region?: any;
    area?: any;
    zone?: any;
    urgency?: any;
    severity?: any;
    certainty?: any;
    limit?: any;
    cursor?: any;
}
export interface AlertsActive {
    status?: any;
    message_type?: any;
    event?: any;
    code?: any;
    region_type?: any;
    point?: any;
    region?: any;
    area?: any;
    zone?: any;
    urgency?: any;
    severity?: any;
    certainty?: any;
    limit?: any;
}
export interface Products {
    location?: any;
    start?: any;
    end?: any;
    office?: any;
    wmoid?: any;
    type?: any;
    limit?: any;
}
export interface Stations {
    id?: any;
    state?: any;
    limit?: any;
}
export interface Zones {
    id?: any;
    area?: any;
    region?: any;
    type?: any;
    point?: any;
    include_geometry?: any;
    effective?: any;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions