ePages-de / ePages-de/restdocs-api-spec

There is no way to indicate the requestBody is required

Open
#253 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Kotlin
Stars
427
Forks
116
Avg merge
23h 54m
Merged PRs (30d)
1

Description

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
```yaml
paths:
/v1/authentication/request:
post:
requestBody:

....
```

TO-BE (if the request body is required)
```yaml
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 to indicate that the requestBody is required.

Is this reasonable?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.