Minimal APIs doesn't describe it's implicit 400 and 415 response behaviors to ApiExplorer
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
Minimal APIs today has a number of implicit behaviors that are performed implicitly based on the declared route handler delegate signature. Most of these behaviors are automatically described to `ApiExplorer` such that OpenAPI/Swagger libraries like Swashbuckle or nSwag can emit OpenAPI information that accurately reflects the behavior of the app's HTTP API endpoints.
Some implicit behaviors are not described however, namely:
- The implicit `400 Bad Request` response in the case that the parameters for the matched route handler delegate cannot be populated from the request, e.g. due to a missing request body or route data parameter
- The implicit `415 Unsupported Media Type` response in the case that the request's `Content-Type` header does not contain a value that matches either the implicit content type supported by Minimal APIs (_application/json_) or one of the specific content types declared by the `ConsumesAttribute` metadata on the route handler delegate
We should decide whether these (and any others I've missed) implicit behaviors should be described to `ApiExplorer` and if not what the principle is that guides which behaviors should and shouldn't be described moving forward.
Contributor guide
Assessment
This issue has not been assessed yet.