Skip to content

fix file and form schema route function - #142

Merged
eadwinCode merged 2 commits into
mainfrom
file_form_schema_fix
Nov 12, 2023
Merged

fix file and form schema route function#142
eadwinCode merged 2 commits into
mainfrom
file_form_schema_fix

Conversation

@eadwinCode

Copy link
Copy Markdown
Collaborator

Whats changed

  • File and Form schema openapi docs
class Range(IntEnum):
    TWENTY = 20
    FIFTY = 50
    TWO_HUNDRED = 200


class Filter(Serializer):
    to_datetime: datetime = Field(alias="to")
    from_datetime: datetime = Field(alias="from")
    range: Range = Range.TWENTY


mr = ModuleRouter("")


@mr.post("/form-schema")
def form_params_schema(
    file: File[UploadFile],
    filters: Filter = Form(..., alias="will_not_work_for_schema_with_many_field"),
):
    return dict(filters.dict(), file_name=file.filename)
Screenshot 2023-11-12 at 12 33 34 PM

…oute function parameter openapi docs when they go together
@eadwinCode eadwinCode changed the title fix file and form schema route function: fixed file and form schema r… fix file and form schema route function Nov 12, 2023
@codecov

codecov Bot commented Nov 12, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Files Coverage Δ
ellar/common/params/args/request_model.py 98.73% <100.00%> (+0.10%) ⬆️
ellar/common/params/resolvers/base.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

📢 Thoughts on this report? Let us know!

@eadwinCode
eadwinCode merged commit c95b307 into main Nov 12, 2023
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

Successfully merging this pull request may close these issues.

1 participant