You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example behavior can be seen on https://demo.nautobot.com/api/docs/ but I do not believe this issue to be specific to our schema or configuration of Swagger-UI (which is using drf-spectactular-sidecar Python package for distribution/installation).
Describe the bug you're encountering
Upon expanding any API endpoint that provides an "Example Value", then selecting "Try it out", it appears that any input into any of the input fields in the UI causes the entire "Example Value" to be regenerated, substantially slowing the UI when the example value (schema) is relatively large and/or complex. This is most noticeable on fields with a regex pattern as a new random string appears in the example value on each such regeneration/refresh.
Worse, this refreshing behavior isn't even specific to the particular API endpoint for which input is being entered -- if multiple API endpoints are expanded, it appears that all "Example Value" data is regenerated on any input to any endpoint, making the slowdown that much more significant.
Can be seen for any API endpoint, but GET /circuits/provider-networks/{id}/ is a decent example.
Expand the endpoint, and click "Try it out".
Enter text into any input field (for example, "id" for the above endpoint)
Observe that each slug field in the "Example Value" is refreshed to a new random value after every keystroke.
Expected behavior
Example values should be generated once and once only and should not change in response to user input. The UI should be more responsive and performant than it currently is.
Screenshots
Note how the slug values (which are defined with a pattern in the schema) change in each successive screenshot:
Additional context or thoughts
Appears related to #7829, may also be a contributing factor to #6787?
The text was updated successfully, but these errors were encountered:
Q&A (please complete the following information)
Content & configuration
Example behavior can be seen on https://demo.nautobot.com/api/docs/ but I do not believe this issue to be specific to our schema or configuration of Swagger-UI (which is using
drf-spectactular-sidecar
Python package for distribution/installation).Describe the bug you're encountering
Upon expanding any API endpoint that provides an "Example Value", then selecting "Try it out", it appears that any input into any of the input fields in the UI causes the entire "Example Value" to be regenerated, substantially slowing the UI when the example value (schema) is relatively large and/or complex. This is most noticeable on fields with a regex
pattern
as a new random string appears in the example value on each such regeneration/refresh.Worse, this refreshing behavior isn't even specific to the particular API endpoint for which input is being entered -- if multiple API endpoints are expanded, it appears that all "Example Value" data is regenerated on any input to any endpoint, making the slowdown that much more significant.
To reproduce...
Steps to reproduce the behavior:
GET /circuits/provider-networks/{id}/
is a decent example.slug
field in the "Example Value" is refreshed to a new random value after every keystroke.Expected behavior
Example values should be generated once and once only and should not change in response to user input. The UI should be more responsive and performant than it currently is.
Screenshots
Note how the
slug
values (which are defined with apattern
in the schema) change in each successive screenshot:Additional context or thoughts
Appears related to #7829, may also be a contributing factor to #6787?
The text was updated successfully, but these errors were encountered: