redoc
redoc copied to clipboard
Plaintext examples are ignored
The following example is a reduced version of my (afaik) valid OpenApi 3 file defining a request body with both application/json and text/plain mimetypes:
openapi: 3.0.3
info:
title: 'Test API'
version: 1.0.0
paths:
/users:
post:
summary: 'Missing CSV examples'
description: 'This demonstrates missing csv examples'
requestBody:
content:
application/json:
schema:
type: object
properties:
records:
type: array
items:
$ref: '#/components/schemas/person'
text/plain:
schema:
type: string
example: "This is a Test"
required: true
responses:
'200':
description: 'Placeholder response'
components:
schemas:
person:
required:
- person_id
- name
type: object
properties:
person_id:
type: integer
description: 'Person identifier in source system'
name:
type: string
description: 'Person name'
example:
person_id: 1
name: 'Hello World'
The official Swagger Editor accepts the plaintext example:

When I generate a standalone HTML file using redoc-cli (Version 0.11.4), the example is ignored:

Also, but probably due to the same bug, when I remove the application/json
This issue might be related to #371.
Is there any update on this issue? how can we show example for text/plain type?
@RomanHotsiy - Do you have an update on the comment you made in #371
ReDoc 2.0 will support all the mime samples correctly so I am not going to fix it properly for ReDoc 1.x
Is there any update on this issue? I'm not able to show the examples of text/plain. @rishagit did you got any solution for this?
This should be updated in Redoc >=2.0, so I'll close this issue - but please let us know if you're still seeing something that doesn't look right?