Forum Discussion
abonstrom
Staff
Hi tomkcook,
Yes it is possible to add an image URL to your OpenAPI docs to render in SwaggerUI. OpenAPI supports markdown and renders images for you. Here is a markdown guide, specifically how to add images: https://www.markdownguide.org/basic-syntax/#images
The following is an example of an image of a bear that can be rendered in SwaggerUI.
## Images
![bear](https://placebear.com/cache/395-205.jpg)
Let me know if this helps!
tomkcook
4 years agoNew Contributor
Thanks. Tracked this down to two separate issues in the end:
- My GFM was incorrect - using square brackets instead of parentheses for the URL.
- I'm using flask_swagger to generate the OpenAPI. Because this scans docstrings, it's usual to have extra indentation at the beginning of each line. In certain cases, flask_swagger doesn't strip this out and so my image link was being treated as preformatted text.
Related Content
- 3 years ago
Recent Discussions
- 3 days ago
- 4 days ago
- 14 days ago
- 31 days ago