Skip to content

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

Open
@rafalkrupinski

Description

@rafalkrupinski

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions