镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Option to rename requestBody #2011

Closed as not planned
Closed as not planned

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,

Activity

  1. mrlubos commented on Feb 4, 2024

    @mrlubos
    Collaborator

    Hey @gersongoulart, I see you have other commits in your fork in addition to this feature, but just wanted to let you know I've also added this feature to our fork. It has some other features too, mostly around OpenAPI 3.1 compatibility

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

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