-
Notifications
You must be signed in to change notification settings - Fork 5
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
[Bug] Fields using alias always return default value #545
Comments
I'm not able to reproduce this for
Check out the tests in FWIW i noticed "self" is passed in as "self_" and so you probably need to add a new field I don't have any events that are returning One way you can "sniff" the response values is adding a root validator on the
Which will log something like this (this example is from the tests but you can use it from the real API too):
|
From my local testing with github.com/home-assistant/core/, the returned
attendees
data seem to be corrupted wheredisplay_name
andresponse_status
always returns the default value, regardless of the actual value.I would think this applies to other fields using alias e.g.
Field(alias="xxx", default=xxx)
.Example (real data with redacted email)
Digging around, I think the issue might be due to the slight nuance of the
alias
feature in pydantic v1 and v2. (apparently home assistant is using v1 whereas gcal_sync supports both v1 and v2)I have no idea why this is case since the unit tests cover both versions.
The text was updated successfully, but these errors were encountered: