Azure / Azure/azure-rest-api-specs
[SecurityInsight][bug] body parameter shall be `required`
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
When I call the following API without body: https://github.com/Azure/azure-rest-api-specs/blob/4d150f815b378ea4eb60128e0b0458210a46d2ab/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/OnboardingStates.json#L81-L111
I get the error:
```
(BadRequest) A non-empty request body is required.
```
But according to swagger definition, `SentinelOnboardingStateParameter` is not required:
https://github.com/Azure/azure-rest-api-specs/blob/4d150f815b378ea4eb60128e0b0458210a46d2ab/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/OnboardingStates.json#L273-L284
So I think the swagger definition is not right, it shall be:
```json
...
"required": true,
...
```
Contributor guide
Research direction
Open specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/OnboardingStates.json and inspect the operation around lines 81-111 and SentinelOnboardingStateParameter around lines 273-284. Confirm the API requires a non-empty body, then update the parameter definition so its required setting matches that behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100