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

swagger-ui-react: spec does not update on prop change and resets to default on page refresh #9965

Closed
glowcloud opened this issue May 27, 2024 · 1 comment

Comments

@glowcloud
Copy link
Contributor

Initial issue reported in swagger-api/swagger-editor#5075

When refreshing the page in Swagger Editor, the specification is not retained. When updating the spec prop, the update is also not reflected. This happens due to the changes to logic that came with the swagger-ui-react component refactor.

We need to keep previous props as references and change the spec update condition to:

if (
 spec &&
 spec !== SwaggerUIConstructor.config.defaults.spec &&
 (spec !== prevStateSpec || spec !== prevSpec)
)
@glowcloud
Copy link
Contributor Author

Addressed in #9966

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants