You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When I request prism with an "accept" header that has multiple types (ex: application/json, text/plain, */*), prism will try to send back "text/plain" response.
To Reproduce
Given this OpenAPI document
openapi: 3.0.0
info:
title: My title
version: 1.0.0
paths:
/check-email:
post:
tags:
- User
summary: Check the availability of an email
requestBody:
content:
application/json:
schema:
type: object
properties:
email:
type: string
example: [email protected]
required: true
responses:
"204":
description: OK, the email is available
content:
application/json:
schema:
nullable: true
"400":
description: Bad Request, the email is not available
content:
application/json:
schema:
nullable: true
Run this CLI command http POST 127.0.0.1:4010/check-email [email protected] Accept:'application/json, text/plain, */*'
See error
{
"detail": "Cannot serialise complex objects as text/plain",
"status": 500,
"title": "Cannot serialise complex objects as text/plain",
"type": "https://stoplight.io/prism/errors#NO_COMPLEX_OBJECT_TEXT_PLAIN"
}
Expected behavior
I expected the server to respond with a 204 response.
Environment (remove any that are not applicable):
Library version: 3.1.0
OS: Ubuntu 18.04.3 LTS (Bionic Beaver)
Additional context
I am using "axios" to make the call and it defaults to application/json, text/plain, */*' for its 'Accept' header.
The text was updated successfully, but these errors were encountered:
Describe the bug
When I request prism with an "accept" header that has multiple types (ex:
application/json, text/plain, */*
), prism will try to send back "text/plain" response.To Reproduce
http POST 127.0.0.1:4010/check-email [email protected] Accept:'application/json, text/plain, */*'
Expected behavior
I expected the server to respond with a
204
response.Environment (remove any that are not applicable):
Additional context
I am using "axios" to make the call and it defaults to
application/json, text/plain, */*'
for its 'Accept' header.The text was updated successfully, but these errors were encountered: