BlackSheep icon indicating copy to clipboard operation
BlackSheep copied to clipboard

Add ContentInfo Type to OpenAPI EndpointDocs.request_body, so docs can test different types of content-type requests.

Open jesseandringa opened this issue 1 year ago • 1 comments

🚀 Feature Request

Right now Endpoint Docs takes in a request_body = @dataclass class RequestBodyInfo: description: Optional[str] = None examples: Optional[Dict[str, Any]] = None

This does not allow for any content type. And defaults to what parameters your function accepts. It would be nice to be able to have a content type so that I could tell the user they can pass application json, and application/msgpack etc. (handling it in a middleware). And provide this information with the request_body, so the user could test out both.

jesseandringa avatar Oct 16 '24 15:10 jesseandringa

Very good point, @jesseandringa. I am handling all pending issues and this is one of those that should be handled. Right now BlackSheep supports a single BodyBinder and a single kind of input per request handler, but it would make sense to support the scenario you are describing. I'll think of a smart way to handle this.

RobertoPrevato avatar May 01 '25 14:05 RobertoPrevato