Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Kieun opened this issue Nov 2, 2023 · 0 comments
Open

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

Kieun opened this issue Nov 2, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Kieun
Copy link
Contributor

Kieun commented Nov 2, 2023

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?

@wodrobina wodrobina added the enhancement New feature or request label Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants