I am using swagger-ui through a React component to display various swaggers, and in the cases of certain swagger specs, the assets do not load correctly. For example --

The lock next to the "Authorize" text is missing.
| Q | A
| ------------------------------- | -------
| Bug or feature request? | Bug
| Which Swagger/OpenAPI version? | 2.0
| Which Swagger-UI version? | 3.1.4
| How did you install Swagger-UI? | npm
| Which browser & version? | Google Chrome 60.0.3112.90 (Official Build)
| Which operating system? | macOS Sierra
Cannot provide entire spec because of confidentiality but can provide certain information about spec.
new SwaggerUIBundle({
dom_id: '#swaggerContainer',
spec: this.state.spec,
presets: [presets.apis]
});
Icons should be present where they are not
Currently missing these icons
I think this is because we're embedding SVGs into our index.html: https://github.com/swagger-api/swagger-ui/blob/master/dist/index.html#L34.
The solution would be to embed the SVG asset directly into the component.
@Minasokoni, thoughts?
@shockey Im going to make the loading of the icons a component and have that append to the DOM so that it loads in with the application without needing the index.html file.
Facing the same issue, any progress on that? :)
@Minasokoni Look at how many people gave you a 馃憤 and you left them all disappointed ;)
I'm still having this issue. Why is this issue closed? Is it resolved somewhere?
@jnovick The issue still open...
Sorry, I saw the word closed referring to Arrow not visible #3995 and thought this issue was marked as closed.
This is fixed! Going forward, you won't need to provide the SVG data in the HTML you use to display Swagger-UI.
Do I have to do something to enable the fix? =S I've updated our Dockerfile for the image that's supposed to include it, swaggerapi/swagger-ui:v3.13.4, but the SVGs don't show up.
@ZimbiX hmm, it's working for me - is this still an issue for you? have you done the hard refresh/empty cache dance?
Locking due to inactivity.
This is done to avoid resurrecting old issues and bumping long threads with new, possibly unrelated content.
If you think you're experiencing something similar to what you've found here: please open a new issue, follow the template, and reference this issue in your report.
Thanks!
Most helpful comment
@shockey Im going to make the loading of the icons a component and have that append to the DOM so that it loads in with the application without needing the index.html file.