swagger-api / swagger-api/swagger-ui
Rendering string:string dictionary example in Schemas
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
Q&A (please complete the following information)
- OS: [e.g. macOS]
- Browser: [chrome]
- Version: [73]
- Method of installation: [editor.swagger.io]
- Swagger-UI version: [e.g. 3.10.0]
- Swagger/OpenAPI version: [OpenAPI 3.0]
Content & configuration
Example Swagger/OpenAPI definition:
components:
schemas:
Order:
type: object
properties:
testMap:
type: object
additionalProperties:
type: string
example:
en-us: Map
fr: le Map
Describe the bug you're encountering
Per https://swagger.io/docs/specification/data-models/dictionaries/
Examples of Dictionary Contents
You can use the example keyword to specify sample dictionary contents:type: object
additionalProperties:
type: string
example:
en: Hello!
fr: Bonjour!
UI does not render any of these examples in the schema section, it only shows { < * >: String }
To reproduce...
Steps to reproduce the behavior:
- Go to editor.swagger.io
- Add a dictionary with examples to a component schema
- Look at render
- See no examples in the schemas section.
Expected behavior
Component schema preview shows examples in-line.
Screenshots

Additional context or thoughts
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in editor.swagger.io with the provided OpenAPI component schema and inspect the schema rendering path for object dictionaries with additionalProperties and example values. Done means the Schemas section displays the supplied en-us and fr example contents inline instead of only showing { < * >: String }.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, openapi
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100