Я пытаюсь создать несколько примеров ответов, которые можно использовать в форматах xml и json
Я пытался написать пример ответа двух типов, но есть ошибка
responses:
'400':
description: Ошибки валидации запроса
content:
application/xml:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
400wrongBodyFormat:
$ref: '#/components/examples/400wrongBodyFormat'
examples:
400wrongBodyFormat:
value:
httpCode: 400
httpMessage: Bad Request
moreInformation: Body of the request is not valid according to json
schema
schemas:
ErrorResponse:
type: object
properties:
httpCode:
type: integer
httpMessage:
type: string
moreInformation:
type: integer
Я хочу получить что-то вроде этого:
<400>
<httpCode>400</httpCode>
<httpMessage>Bad request</httpMessage>
</400>
Но получаю это
{
"httpCode": 400,
"httpMessage": "Bad Request",
"moreInformation": "Body of the request is not valid according to json schema"
}