We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Draive is unable to build a validator for StrEnum. It uses list_validator but doesn't get a range of available values.
Error:
draive.parameters.errors.ParameterValidationError: ("Validation error: Invalid parameter value at: %s - expected '%s' while received '%s'", UserProfileDraive.goals[0], (), <Goal.GENERAL_WELLNESS: 'GENERAL_WELLNESS'>)
Example code:
from enum import StrEnum from draive import DataModel class Goal(StrEnum): GENERAL_WELLNESS = "GENERAL_WELLNESS" INCREASE_ENERGY = "INCREASE_ENERGY" ENHANCE_FOCUS = "ENHANCE_FOCUS" OTHER = "OTHER" class UserProfileDraive(DataModel): name: str goals: list[Goal] user_profile_draive = UserProfileDraive(name='Piotr', goals=[Goal.GENERAL_WELLNESS]) user_profile_draive_json = user_profile_draive.as_json() print(user_profile_draive_json)
The text was updated successfully, but these errors were encountered:
It seems that there is some missing part when decoding Enum based types, I will take a closer look at it
Sorry, something went wrong.
No branches or pull requests
Draive is unable to build a validator for StrEnum. It uses list_validator but doesn't get a range of available values.
Error:
Example code:
The text was updated successfully, but these errors were encountered: