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

2.0.0-rc.28 t.required.indexOf is not a function #1261

Closed
cnizzardini opened this issue May 18, 2020 · 2 comments
Closed

2.0.0-rc.28 t.required.indexOf is not a function #1261

cnizzardini opened this issue May 18, 2020 · 2 comments

Comments

@cnizzardini
Copy link

cnizzardini commented May 18, 2020

Getting the following error with 2.0.0-rc.28. This same schema loads into Swagger just fine.

t.required.indexOf is not a function
Stack trace
TypeError: t.required.indexOf is not a function
at http://localhost/redoc.standalone.js:130:54204
at Array.map ()
at http://localhost/redoc.standalone.js:130:54018
at e.init (http://localhost/redoc.standalone.js:130:54727)
at new e (http://localhost/redoc.standalone.js:130:51696)
at new e (http://localhost/redoc.standalone.js:130:59448)
at http://localhost/redoc.standalone.js:130:60804
at Array.map ()
at new e (http://localhost/redoc.standalone.js:130:60752)
at new Gt (http://localhost/redoc.standalone.js:130:61517)

ReDoc Version: 2.0.0-rc.28
Commit: 18dbd62

@RomanHotsiy
Copy link
Member

required should be an array in Schema objects. You probably use required: true

See example here, boolean in parameters, array in the schema:

https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#operation-object-example

image

@cnizzardini
Copy link
Author

Yes, this was the issue. I thought I had run it through the schema validator before posting this. 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