Open be-a-sid opened 1 year ago
Is there a workaround for this while this is not implemented?
Hi this is an issue for us, since it would help us with big payloads
Any updates on this?
Since 5.17.14 the swagger-ui-react seems to export "config" property. Thus before using the you can write something like:
import SwaggerUI from 'swagger-ui-react';
SwaggerUI.config.defaults.syntaxHighlight.activated = false;
...
<SwaggerUI spec={...} />
Mind any TypeScript type issues, if you need to disable linter or any type access.
Q&A (please complete the following information)
Content & configuration
Swagger-UI configuration options:
Describe the bug you're encountering
Because
syntaxHighlight
prop is not supported by swagger-ui-react, theagate
theme is always used by default for syntax highlighting.Expected behavior
Support
syntaxHighlight
prop in swagger-ui-reactAdditional context or thoughts
The swagger page becomes unresponsive when syntax highlighting is enabled and the response payload is huge (swagger-ui open issues related to this #8260 #3832 ). Workaround for this is to disable the syntax highlighting by setting the
syntaxHighLight
prop tofalse
.Since
swagger-ui
already supports configuring this prop, I believe appending the following line to constructor block inswagger-ui-react
should do the trick.