Skip to content

Option to rename requestBody #2011

Open
@gersongoulart

Description

@gersongoulart

In the OpenAPI v3 spec, the requestBody does not have a name. By default, it will be passed into the generated function as requestBody.

It would be nice to accept the commonly used x-body-name property in the operation schema to override this name.

Example:

paths:
  /foo:
    post:
      operationId: api.foo_get
      requestBody:
        x-body-name: payload
        content:
          application/json:
            schema:
              ...
# default
body: requestBody,

# based on x-body-name
body: payload,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions