redoc
redoc copied to clipboard
Redoc taking lot of time to render documentation
Describe the bug Redoc taking lot of time to load the page, Its taking approx 1 min to load the documentation
Expected behavior Redoc renders docs in few seconds
Additional context Browser: chrome, firefox
We are getting 12000+ warnings mentioned below in console and page is rendered only after 1 min, till then it was just showing loading icon. And the memory used by javascript VM instance is 1875MB
Size of spec(yaml): 42KB
Warning messages:
(index):16 Incompatible types in allOf at "#/components/schemas/FormFieldComponent/oneOf/7/properties/label": "object" and "string"
value @ (index):16
(index):16 Incompatible types in allOf at "#/components/schemas/FormFieldComponent/oneOf/7/properties/hint": "object" and "string"
value @ (index):16
(index):16 Incompatible types in allOf at "#/components/schemas/FormFieldComponent/oneOf/7/properties/placeholder": "object" and "string"
try removing the -
on the type
field and repositioning the allOf
reference. allOf
needs a property association
should look like this:
FormFieldComponent:
type: object
properties:
components:
allOf:
- $ref: '#/components/schemas/DataComponent'
- $ref: '#/components/schemas/Component'
label:
type: string
hint:
type: string
placeholder:
type: string
apply:
$ref: '#/components/schemas/Apply'
@jeremyfiel We generated this YAML using micronaut-openapi(io.micronaut.openapi:micronaut-openapi:3.2.0).
Does that mean it is generated file in wrong format ?
And we don't have a property named "components" in FormFieldComponent
- DataComponent extends Component
- FormFieldComponent extends DataComponent
Hence the file is generated is like this
@prabhutw I may have misunderstood it previously.
I think it may be associated to this https://github.com/Redocly/redoc/issues/907
sounds like it may not be able to discriminate between object <> string in your oneOf declaration
Thanks for pointing it out @jeremyfiel But converting the error to warning did not solve the issue. What could be fix for this issue? I can contribute for this
Can someone help to resolve this issue?
In chrome browser, its taking 2014MB of heap size
Just ran into the same issue. Causes Chrome to crash. Not a complicated schema