| Q | A
| ----------------------------------- | -------
| Bug or feature request? | Bug
| Which Swagger/OpenAPI version? | 3.0
| Which Swagger-Editor version? | 3.1.20
| How did you install Swagger-Editor? | git clone + npm start
| Which broswer & version? | Chromium 63
| Which operating system? | Linux Mint
swagger: "2.0"
info:
description: "my api"
version: "0.1.0"
title: "my apiI"
host: "my.api.com"
basePath: "/myapi"
tags:
- name: "tag1"
schemes:
- "https"
paths:
/thing:
post:
tags:
- "tag1"
summary: ""
description: ""
operationId: "op1"
consumes:
- "application/json"
produces:
- "application/json"
- "application/json+problem"
parameters:
- in: "body"
name: "body"
description: ""
required: true
schema:
$ref: "#/definitions/RequestBody"
responses:
'400':
description: ""
content:
application/json+problem:
schema:
$ref: "#/definitions/ErrorResponse"
all default, no query string
There should not be validation error AND there should be auto complete on "content" property
Validation error : "Schema error at paths['/thing'].post.responses['400']
should NOT have additional properties
additionalProperty: content, description"
Trying to use OAS 3 response objects
@gnieutin the error is valid, it occurs because you are mixing Swagger 2.0 and OpenAPI 3.0 syntax. The content keyword is part of OpenAPI 3.0, it's not supported in Swagger 2.0.
You need to change your response definition to:
responses:
'400':
description: ""
schema:
$ref: "#/definitions/ErrorResponse"
This guide describes the 2.0 syntax for responses: https://swagger.io/docs/specification/2-0/describing-responses/
Thanks @hkosova, didn't notice the swagger: "2.0".
Moving this to support!
Closing due to inactivity.
This is simply to keep our issue tracker clean - feel free to comment if there are any further thoughts or concerns, and we'll be happy to reopen this issue.
You pointed the right mistake of mine... thank you :)
Sorry for late posting, I wanted to test something else before coming back to you.
Using openapi: '3.0.0' and doing some changes made it work !
Problem solved.
Most helpful comment
You pointed the right mistake of mine... thank you :)
Sorry for late posting, I wanted to test something else before coming back to you.
Using
openapi: '3.0.0'and doing some changes made it work !Problem solved.