Skip to content
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

Drop and log unknown capabilities, log responses, deserialize with Pydantic #6

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

dvx76
Copy link
Member

@dvx76 dvx76 commented Sep 18, 2024

Logging API responses will help debugging issues reported by users, like skodaconnect/homeassistant-myskoda#18

I started working on replacing pydantic with mashumaro but I'm not convinced yet. Pydantic does a lot of nice things and does them elegantly, like this additional validator which will drop unknown capabilities. It also enforces types and even coerces 'wrong' types into the desired type. So these validators to convert str to int aren't actually required. Use pydantic (.parse_raw()) to de-serialize the json responses.

The API responses will help debugging issues reported by users.
@dvx76 dvx76 requested review from WebSpider and Prior99 September 18, 2024 20:01
@dvx76
Copy link
Member Author

dvx76 commented Sep 18, 2024

Just noticed this includes/obsoletes #3

Copy link
Contributor

@WebSpider WebSpider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@WebSpider
Copy link
Contributor

Yeah basically the same thing as #3

@Prior99 Prior99 merged commit 05276fb into skodaconnect:main Sep 19, 2024
1 check passed
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.

3 participants