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

Typeerror when I expand a field in a rendered OpenAPI 2.0 spec #505

Closed
imnotashrimp opened this issue May 24, 2018 · 6 comments
Closed

Typeerror when I expand a field in a rendered OpenAPI 2.0 spec #505

imnotashrimp opened this issue May 24, 2018 · 6 comments

Comments

@imnotashrimp
Copy link

imnotashrimp commented May 24, 2018

I got this error when I expanded the triggerOn parameter in my OpenAPI 2.0 spec. Everything rendered normally, with no errors.

From my Chrome console:

TypeError: Cannot read property 'fields' of undefined
    at t.render (ObjectSchema.tsx:24)
    at x (mobx.module.js:235)
    at index.module.js:741
    at Mt (mobx.module.js:3277)
    at e.track (mobx.module.js:3481)
    at t.i [as render] (index.module.js:736)
    at t.<anonymous> (index.module.js:805)
    at t.c.render (index.module.js:923)
    at h (react-dom.production.min.js:131)
    at beginWork (react-dom.production.min.js:138)
wr @ react-dom.production.min.js:151

image

ReDoc v 2.0.0-alpha.20
Commit 0a9d09d

I use Redoc from the CDN-
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>

@RomanHotsiy
Copy link
Member

Minimal reproducible sample?

@imnotashrimp
Copy link
Author

Sorry, accidentally hit enter- can I email my spec file, or would you like it attached here?

@imnotashrimp imnotashrimp changed the title Typeerror: Typeerror when I expand a field in a rendered OpenAPI 2.0 spec May 24, 2018
@RomanHotsiy
Copy link
Member

It doesn't matter. Whatever is better for you!

@imnotashrimp
Copy link
Author

https://github.com/imnotashrimp/logz-docs-test/blob/develop/_source/api-src/logzio-public-api.yaml

The problem is when I expand triggerOn (line 1788), which references the TriggerOn definition (line 1862)

@RomanHotsiy
Copy link
Member

You are using discriminator incorrectly. You don't have any definition inherited from the TriggerOn

Check out discriminator docs: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#fixed-fields-13

I will add more details to the error message besides just Typeerror though.

@imnotashrimp
Copy link
Author

Thank you! Our spec was auto-generated, so I'll look into this on our end as well.

Appreciate the help

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