skodaconnect / myskoda

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

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

Closed dvx76 closed 4 days ago

dvx76 commented 4 days 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 4 days ago

Just noticed this includes/obsoletes #3

WebSpider commented 4 days ago

Yeah basically the same thing as #3