Skip to content

[REQ] [sprind-cloud] Provide multiple response bodies  #8701

Description

@MelleD

Is your feature request related to a problem? Please describe.

There should be support for several response bodies. The challenge will be that spring needs several methods for different media types.

Describe the solution you'd like

Example with different response bodies

  /foo:
    post:
      operationId: createFoo
      ...
      responses:
        '200':
          description: "Return"
          content:
                    application/octet-stream:
                      schema:
                        type: string
                        format:binary
                    text/plain:
                      schema:
                        type: string
                    application/json:
                      schema:
                         ref: "#/components/schemas/FooDto"

The generated code should contain 3 methods

@RequestMapping(produces = "application/octet-stream")
public ResponseEntity<Resource> createFoo1(...) {...}

@RequestMapping(produces = "text/plain")
public ResponseEntity<String> createFoo2(...) {...}

@RequestMapping(produces = "application/json")
public ResponseEntity<FooDto> createFoo3(...) {...}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions