swagger-js
swagger-js copied to clipboard
POST application/xml doesn't work
https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-3/832/io.swagger.codegen.v3$swagger-codegen-cli/artifact/io.swagger.codegen.v3/swagger-codegen-cli/3.0.21-SNAPSHOT/swagger-codegen-cli-3.0.21-SNAPSHOT.jar
Generated nodejs-server from the above build.
/foo/config:
post:
tags:
- Foo
summary: config info.
description: Send config info.
operationId: config_info
requestBody:
description: Configuration Information
content:
application/xml:
schema:
$ref: '#/components/schemas/Some_Configuration'
required: true
responses:
"200":
description: Success. Some Configuration Information received.
content: {}
"400":
description: Failure. Some Configuration Information could not be processed.
content: {}
"500":
description: Server error.
content: {}
x-swagger-router-controller: Foo
x-codegen-request-body-name: body
Expected behaviour: XML is passed to the server and can be processed. undefined
is received.
The issue seems to lie in the schema. If it's a plain "string", then you get invalid XML in the Online doc, but you can send in the XML. If you have a "proper" schema, then it fails to send.
type: "object"
for the schema seems to cause a problem.