-
-
Notifications
You must be signed in to change notification settings - Fork 453
Closed
Copy link
Labels
component:lib-commonsIssue related to the @mockoon/commons libIssue related to the @mockoon/commons libeffort:easyQuick fixes or small tasksQuick fixes or small taskspriority:lowNice-to-have features or minor issuesNice-to-have features or minor issuesstatus:approvedIssue confirmed for implementationIssue confirmed for implementation
Milestone
Description
Describe the bug
When importing an environment from an OpenAPI/Swagger document, any responses with the content type application/problem+json is imported without a generated body.
If I change the media type to application/json in the same OpenAPI document, Mockoon generates a body as expected.
This makes it difficult to work with APIs that use RFC 7807 problem details, which typically use application/problem+json as their content type.
Steps to Reproduce
- Create a new local environment from OpenAPI/Swagger
- Paste the OpenAPI spec content below:
paths:
/memes/{memeId}:
parameters:
- name: memeId
in: path
description: meme Object Id
required: true
schema:
$ref: '#/components/schemas/MemeId'
get:
summary: Returns one meme with specified Id.
description: This resource represents an individual meme in the system. Each meme is identified by a id.
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/Meme"
"400":
description: A JSON array of Error Details
content:
application/problem+json:
schema:
$ref: "#/components/schemas/ErrorDetails"
'401':
description: Unauthorized
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorDetails'
'404':
description: Not Found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorDetails'
example:
error: NOT_FOUND
errorDescription: Meme not found
errorUri: https://foo.bar.com/error
errorId: "not-found-123"
additionalMessages: []
- Complete the import and inspect the generated response
- Now change the content type in the OpenAPI document from appication/problem+json to application/json, re-import and compare the generated response body
Mockoon version:
9.4.0
OS / OS version:
Windows 11
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
component:lib-commonsIssue related to the @mockoon/commons libIssue related to the @mockoon/commons libeffort:easyQuick fixes or small tasksQuick fixes or small taskspriority:lowNice-to-have features or minor issuesNice-to-have features or minor issuesstatus:approvedIssue confirmed for implementationIssue confirmed for implementation
Type
Projects
Status
📦 Released (v9.5.0)