skodaconnect / myskoda

Python library for interacting with MySkoda APIs.
MIT License
9 stars 22 forks source link

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

Closed dvx76 closed 2 months ago

dvx76 commented 2 months ago

Logging API responses will help debugging issues reported by users, like https://github.com/skodaconnect/homeassistant-myskoda/issues/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.

dvx76 commented 2 months ago

Just noticed this includes/obsoletes #3

WebSpider commented 2 months ago

Yeah basically the same thing as #3