Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST application/xml doesn't work #1647

Open
andrew-mclachlan opened this issue Jul 18, 2020 · 2 comments
Open

POST application/xml doesn't work #1647

andrew-mclachlan opened this issue Jul 18, 2020 · 2 comments

Comments

@andrew-mclachlan
Copy link

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.

@andrew-mclachlan
Copy link
Author

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.

@andrew-mclachlan
Copy link
Author

type: "object" for the schema seems to cause a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants