Skip to content

There is no way to indicate the requestBody is required #253

@Kieun

Description

@Kieun

With current implementation, in case where there is request body for the API, the generated spec always presents that the request body is optional (which is not marked with required).

AS-IS

paths:
  /v1/authentication/request:
    post:
      requestBody:

....

TO-BE (if the request body is required)

paths:
  /v1/authentication/request:
    post:
      requestBody:
         required: true
....

It seems that there is no way to mark required for RequestFieldsSnippet, such as optional() or required() method. Instead, we might leverage attributes, Map<String, Object> to indicate that the requestBody is required.

Is this reasonable?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions