-
Notifications
You must be signed in to change notification settings - Fork 272
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
Redoc view broken #631
Comments
This seems like an upstream issue. We use a CDN for the UIs. Redoc is vanilla and swagger only has minor changes. They both use the latest version via CDN. You can change this with our settings: SPECTACULAR_SETTINGS = {
'REDOC_DIST': 'https://cdn.jsdelivr.net/npm/redoc@latest',
} Upstream problems usually get resolved quickly. Otherwise change the |
thanks tfranzel, i tried your settings with many version but without effect. you are right, it seems the error come from redoc, if you search "slugify" in redoc https://cdn.jsdelivr.net/npm/[email protected]/bundles/redoc.standalone.js you find the message and yes probably a comparison failed |
If this happens for several different version, we may need look into it. ReDoc has been working fine last I checked. Maybe it chokes on your specific schema for some reason. Generally it's not supposed to throw exceptions no matter what the schema contains. It's hard to say more without the actual schema that produces the error. Maybe we produce a schema ReDoc has issues with. I would need more context to investigate. In either case you should open an issue upstream. |
I can't share the entire schema because he contains sensible informations, but i can confirm that file is valid for pyyaml. the safe_load() work without error. i will try to remove specific part to see if redoc return view... |
yeah I figured that. Valid yaml does not necessarily mean valid OpenAPI. A better indicator would be do validate the schema against the OpenAPI specification:
But that again is not gonna catch all potential issues. You will need to produce a minimal reproduction, otherwise I can't really do anything. Have you checked if SwaggerUI works as expected? that could give a hint. I would start removing stuff from the schema until its not broken anymore. |
Ok bad news for me ... i checked the schema with spectacular --validate : he return 8 errors but without important just missing serializer in viewset and he say that he ignore it... |
the warning are there to guide you to a accurate schema. 99% of those default to something valid, however that may not match your API perfectly, hence the warning. they are supposed to be fixed with If the command does not fail with a big stacktrace (highlighting the offenses) then the schema appears to be valid wrt the OpenAPI specification. pretty sure |
looks like this could be related: Redocly/redoc#690 though I would have thought that specific issue with tags would make |
Hi tfranzel, i found the origin issue ! it is because i have "tags" key at the end of my schema :
redoc-cli return the same error when i have this element in my schema (slugify ...) Edit : |
So it is a upstream issue after all i suppose. for us there is nothing really that we should or could change. You should open an issue with them with a minimal reproduction. you can reference this issue. |
closing this issue for now. feel free to comment if anything is missing or not working and we will follow-up. |
The interface redoc is broken (/api/schema/redoc)
Something went wrong...
slugify: string argument expected
Stack trace
Error: slugify: string argument expected
at n (https://cdn.jsdelivr.net/npm/redoc@latest/bundles/redoc.standalone.js:2:563232)
at mo (https://cdn.jsdelivr.net/npm/redoc@latest/bundles/redoc.standalone.js:2:723535)
at new e (https://cdn.jsdelivr.net/npm/redoc@latest/bundles/redoc.standalone.js:2:884763)
at Function.value (https://cdn.jsdelivr.net/npm/redoc@latest/bundles/redoc.standalone.js:2:887393)
at Function.value (https://cdn.jsdelivr.net/npm/redoc@latest/bundles/redoc.standalone.js:2:886368)
at new e (https://cdn.jsdelivr.net/npm/redoc@latest/bundles/redoc.standalone.js:2:884072)
at new e (https://cdn.jsdelivr.net/npm/redoc@latest/bundles/redoc.standalone.js:2:945634)
at https://cdn.jsdelivr.net/npm/redoc@latest/bundles/redoc.standalone.js:2:815343
at Object.Sa [as useMemo] (https://cdn.jsdelivr.net/npm/redoc@latest/bundles/redoc.standalone.js:2:485468)
at Object.t.useMemo (https://cdn.jsdelivr.net/npm/redoc@latest/bundles/redoc.standalone.js:2:546743)
ReDoc Version: 2.0.0-rc.59
Commit: 9f564d3
version of spectacular 0.21.1
The text was updated successfully, but these errors were encountered: