Redocly / Redocly/redoc

Auto generate `text/csv` code examples based on the schema

Open
#2,339 1 comment 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
A clear and concise description of what problem to be solved
We want to be able to auto generate text/csv code examples based on the schema, as opposed to providing a code example ourselves.

Describe the solution you'd like
A clear and concise description of what you want to happen.
I would like a solution that supports a schema with a single object - the properties of the object could be the column headers while the example values will be the values. As well as supporting a schema with an array of objects - potentially displaying multiple rows.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
For now we are providing CSV code examples ourselves in the Response, however it would be good to avoid having to maintain plain text examples so that if the model in our backend changes, the schema would be reflected with little to no effort.

Additional context
Add any other context or screenshots about the feature request here.
Some things that I haven't considered is the use of allOf or oneOf in the OpenAPI spec.

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

No file or test is named. Start by locating the TypeScript handling for text/csv responses and schema-based examples, then determine how single objects and arrays of objects are represented. Done should mean CSV examples are generated from schema properties and example values, with the behavior for allOf and oneOf explicitly decided.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api, documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.