You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I love the Python dataclasses and enjoyed using them with APIFlask so far, through marshmallow_dataclass.
But using the OneOf from apiflask.validators with sublasses (non-native types) raises Errors for me. How should I use it ?
Something like:
frommarshmallow_dataclassimportdataclassfromapiflask.validatorsimportOneOf@dataclassclassSubClassA:
attribute: float@dataclassclassSubClassB:
something: str@dataclassclassInputClass:
attribute_1_with_choice: Union[SubClassA, SubClassB] # this fails.attribute_2_with_choice: OneOf((SubClassA, SubClassB)) # this fails as well
Or would it be possible to use the standard typing.Union for APIFlask to understand the OneOf ?
The text was updated successfully, but these errors were encountered:
I love the Python dataclasses and enjoyed using them with APIFlask so far, through
marshmallow_dataclass
.But using the OneOf
from apiflask.validators
with sublasses (non-native types) raises Errors for me. How should I use it ?Something like:
Or would it be possible to use the standard
typing.Union
for APIFlask to understand theOneOf
?The text was updated successfully, but these errors were encountered: