Redocly / Redocly/redoc

Extend rendering of nested object query parameter examples in style deepObject

Open
#2,191 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Enhancement
Dominant language
TypeScript
Stars
25.9k
Forks
2.4k
Avg merge
13h 10m
Merged PRs (30d)
4

Description

Describe the problem to be solved
Parameter examples of nested objects are not rendered in an intuitive manner.

Use case: Filtering a list of echo messages with the following data model using the MetaData nested object query parameter.
Model

Example parameter as currently rendered by Redoc:
metaData[decibel]=80&metaData[category]=[object Object]

Describe the solution you'd like
Add option of an opinionated rendering of nested object query parameter examples with style deepObject.
Swagger UI seems to serialize such objects in this manner when using the "Try it out" feature:

metaData[decibel]=80&metaData[category][genre]=prophanity&metaData[category][complexity]=word

Describe alternatives you've considered
Including hand crafted query parameter examples in the parameter description. A last resort solution. We would like for examples to be rendered in a consistent manner regardless of the complexity of the objects, and being automatically adjusted to the style and explode attributes.

Additional context
An example API specification is included in the attached zip file.
echo.yaml.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached echo.yaml.zip specification and reproduce the current deepObject rendering, especially the nested MetaData category example. Compare the output with the requested bracketed serialization and verify that nested examples render consistently according to style and explode attributes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.