This is a feature request.
We have the following OpenAPI document:
# ... metadata
paths:
/api/path:
post:
summary: ...
description: ...
operationId: operation
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Model'
application/xml:
schema:
$ref: '#/components/schemas/Model'
responses:
# ...
The model contains an xml key to describe the XML tag which is used to instantiate the model.
components:
schemas:
Model:
xml:
name: model
type: object
properties:
# ...
Then, we fire an XML request, but this fails the validation
# ./spec/controllers/api/...'
# ------------------
# --- Caused by: ---
# OpenAPIParser::ValidateError:
# #/components/schemas/Model expected object, but received String: <?xml version="1.0" encoding="UTF-8"?>
# <model>
# <property>94cf1162-0897-42f9-9dcb-9bd9abe7aa17</property>
# </model>
# ./spec/controllers/api/...
The XML is returned correctly, and matches the OpenAPI specification. The request validator interprets the XML response (application/xml content type) as a String.
This is a feature request.
We have the following OpenAPI document:
The model contains an
xmlkey to describe the XML tag which is used to instantiate the model.Then, we fire an XML request, but this fails the validation
The XML is returned correctly, and matches the OpenAPI specification. The request validator interprets the XML response (
application/xmlcontent type) as a String.