See it as a diagram
Everything below, as a diagram you can edit. Describe yours and see it in seconds.
No account needed · Editable canvas, not a picture
Every description field is markdown
The OpenAPI specification treats description fields as markdown throughout: info.description, the description on each tag, and the description on each operation. Swagger UI renders them and sanitizes the result. Redoc renders CommonMark and additionally lifts first-level headings out of info.description into its side menu, so a heading plus an image gives you an overview section that readers can navigate to.
That makes info.description the natural home for one architecture diagram, and tag descriptions the home for scoped ones. A payments tag can carry the picture of the payments path; an events tag can carry the queue topology behind webhooks.
Nothing about this requires a docs portal product. It works in whatever renders your spec, including the Swagger UI shipped by a framework in development mode.
openapi: 3.1.0
info:
title: Payments API
version: "2.4.0"
description: |
## Architecture

Requests enter through the gateway, are authorised by the ledger service,
and settle asynchronously through the events queue.The YAML mechanics that break the image
The description has to be a literal block scalar, written with the pipe character, so line breaks survive. A folded scalar joins lines together, which glues your image line to the paragraph after it and produces markdown that no longer parses as an image.
Indentation inside the block matters as much as anywhere else in YAML: everything in the block must be indented consistently relative to the key, or the parser truncates the description at the first offending line. If half your overview text vanished, look there before blaming the renderer.
A URL inside a plain scalar contains a colon, which YAML can read as a mapping separator in some positions. Inside a block scalar it is safe, which is one more reason to use the pipe form rather than a single-line string.
What the renderers remove
Both renderers sanitize the HTML they produce from your markdown, and iframes and scripts do not survive that pass. There is no interactive diagram inside an API reference; the image is the embed, and a plain link next to it serves readers who want pan and zoom.
Keep the markup simple for the same reason. An image line, a heading, and a paragraph render identically in Swagger UI, Redoc and the many tools that read the same spec, while anything clever tends to survive in one of them and disappear in another.
The Content Security Policy on your docs host
This is the failure that wastes an afternoon. The spec is correct, the markdown is correct, and the diagram shows as a broken image because the page serving Swagger UI sends a policy with img-src limited to self. The browser console says so plainly, and nothing in the spec file can override it.
API portals are more likely than most sites to ship a strict policy, since they often sit behind the same gateway as the API. Either add the diagram host to img-src, or serve an exported PNG from your own origin and accept that it freezes at deploy time.
The equivalent applies to any docs-portal proxy that rewrites or blocks external references. Test the rendered page, not just the spec, before declaring it done.
Why the address matters here
Generating the picture from the spec and the repository
An OpenAPI file already describes a surface: tags, operations, request and response shapes. Turning that into a diagram of the system behind the surface is covered in a living diagram from OpenAPI.
For the fuller picture, connect the repository read-only from GitHub, GitLab or Azure DevOps and let the daily sync regenerate the diagram and an architecture.md from the source, so the drawing in your API reference tracks the services rather than one snapshot of them. See repo to diagram.
One rendering decision is worth knowing if your infrastructure leans on the Terraform Registry. A module whose source is a registry or git address cannot be expanded, because its files are not in your repository, so it becomes exactly one node standing for everything it provisions, labelled with the source and the pinned version from the module block and given an icon inferred from the source string: a source containing vpc draws with the VPC mark, refined to the Azure virtual network mark when the source names Azure. That is the honest rendering. A box reading terraform-aws-modules/vpc/aws at 5.1.2 tells an integrator more than five invented subnets would.
FAQ
Can I put an image in an OpenAPI description field?
Why is my image missing from the rendered API reference?
Can I embed an interactive diagram in Swagger UI or Redoc?
Where should the diagram go: info.description or a tag?
Can the diagram change without redeploying the spec?