-
Notifications
You must be signed in to change notification settings - Fork 142
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
feat: roll openapi json into fastapi #359
Conversation
…be managed by fastapi)
@awalker4 should I remove |
multipage_sections: bool | ||
new_after_n_chars: Optional[int] | ||
|
||
@classmethod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take it this is for the backwards compatibility? Can we have a comment here to clarify how new params should be added (assuming they do not need to go into as_form
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for backward compatibility I added:
BeforeValidator(SmartValueParser[List[str]]().value_or_first_element),
In old fields that expected values both as a single value or as an element of a list.
The SmartValueParser
will extract the first element from the list if the expected type is not a container.
SmartValueParser
is a generic class and is parametrized with the expected type - in the above example its List[str]
You can check its tests to see how it's working:
SmartValueParser tests
Deprecated API tests (with params passed as lists)
Yes please! |
This PR:
pydantic
to 2.5.x and removes it from explicit dependencies list (will be managed by fastapi)list[str]
(will not be shown in the documentation)