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

fix: fix error when updating logo with BaseLayout #77

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

satazor
Copy link
Contributor

@satazor satazor commented Jul 19, 2023

Fixes #76

Not sure how to test this. The current test suit checks the HTML response, meaning there's no way to test that actual runtime JavaScript errors occur.

Checklist

Copy link
Collaborator

@Uzlopak Uzlopak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your code is one way to solve it.

The issue here is, that swagger-ui supplies two layouts: 'BaseLayout' and 'StandaloneLayout'
In StandaloneLayout we know where the logo needs to be patched. In BaseLayout we dont have a logo, thats why we get that error.

We should check if we have StandaloneLayout and if so, patch it.

Also by checkit if layout is StandaloneLayout the reported error becomes more obvious, why it never could work in BaseLayout

lib/swagger-initializer.js Outdated Show resolved Hide resolved
@satazor satazor force-pushed the bugfix/logo-basic-layout branch from 62c2d06 to 11d6c11 Compare July 19, 2023 14:40
@satazor satazor force-pushed the bugfix/logo-basic-layout branch from 11d6c11 to 964c483 Compare July 19, 2023 14:42
Copy link
Collaborator

@Uzlopak Uzlopak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks for your work

@Uzlopak Uzlopak merged commit 1cd21af into fastify:master Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error trying to update logo src when using BaseLayout
3 participants