swagger-api / swagger-api/swagger-client

POST application/xml doesn't work

Open
#1,647 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug version: 3.x
Dominant language
JavaScript
Stars
2.7k
Forks
765
Avg merge
1d 1h
Merged PRs (30d)
6

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the generated nodejs-server from the linked swagger-codegen build using the provided OpenAPI request definition and an application/xml POST. Trace the request-body handling from the generated server entry point; done when the XML payload reaches the server for processing instead of being received as undefined.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.