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

Cannot convert undefined or null to object #73

Closed
mbohgard opened this issue Oct 14, 2019 · 2 comments
Closed

Cannot convert undefined or null to object #73

mbohgard opened this issue Oct 14, 2019 · 2 comments

Comments

@mbohgard
Copy link

What version of OpenAPI is supported? Running npx @manifoldco/swagger-to-ts test.yaml --output schema.d.ts on

openapi: 3.0.0
info:
  version: "0.2"
  title: test
paths:
  /test:
    get:
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Response"
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/platform/schemas/Nope"
components:
  schemas:
    Response:
      type: object
      properties:
        type: array
        items:
          type: string
  platform:
    schemas:
      Nope:
        type: object
        required:
          - type
        properties:
          type:
            type: string

results in Cannot convert undefined or null to object.

@tombarton
Copy link
Contributor

This library only supports Swagger 2.0. See https://github.com/manifoldco/swagger-to-ts#node-options

@mbohgard
Copy link
Author

Aha, I was looking for any docs on that but couldn't find it. Didn't look too closely I guess. Thanks.

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

2 participants