-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
The typical usage of RequestBody annotation is:
body: Annotated(RequestBodyType, RequestBody({'application/json': RequestBodyType}))with a single key-value pair, where
- RequestBodyType is a concrete, non-Union, possibly Optional, model type
- the key is typically 'application/json'
These alternative shortcut forms could be allowed, to better support human authors:
body: Annotated(RequestBodyType, RequestBody()) # only accept 'application/json' and map the body to ResultType
body: Annotated(RequestBodyType, RequestBody('application/json')) # only accept the given media type, and map to ResultTypeMetadata
Metadata
Assignees
Labels
No labels