Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing dict[type, str] to RequestBody() #49

Open
rafalkrupinski opened this issue Jan 19, 2024 · 0 comments
Open

Allow passing dict[type, str] to RequestBody() #49

rafalkrupinski opened this issue Jan 19, 2024 · 0 comments

Comments

@rafalkrupinski
Copy link
Contributor

Currently RequstBody follows OpenAPI responses.content map of media-type to python type (schema in OpenAPI).

This must be kept for compatibility with OpenAPI, as lapidary-render will output the map with just schemas replaced with python types.

Additionally a simplified style should be accepted:
a map of python type to concrete media-type (not media-range).

RequestBody({
    ModelType: 'application/json',
    OtherType: 'application/json',
    bytes: 'application/octet-stream',
})

This would be more intuitive to the user, and would unambiguously determine the value of Content-Type header.

Also, the OpenAPI style allows a python type to be mapped to multiple media types, making it necessary to require a parameter for the content-type header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant