ABS Inconsistent Typings in API #51
Replies: 1 comment 1 reply
-
I think ABS has gotten better about this in recent versions. However, as far as I am aware, ABS doesn't do database type checks, so old entries can still have incorrect types. I think creating an issue for this on the main ABS repo is a good idea. I haven't tested this library against an actual ABS server other than a few basic things. If fixes on the server side aren't feasible, json_seralizable lets you define converters for converting between types that we could put the coercion logic in. I use them already for |
Beta Was this translation helpful? Give feedback.
-
So something I've run into making Audiobookly is that ABS tends to be fast and loose with types on attributes in responses. Things will either be a cron expression or false, like the ServerSettings.backupSchedule. Or a timestamp will randomly be a double for... Reasons. Chapter durations are sometimes strings. It's common enough that I had to create specific coercion functions in the parsing logic as different edge cases presented themselves. The nature of the javascript API is such that types will never be enforced.
I have been playing around integrating this library into Audiobookly and it's to the point where I am just hunting down parsing errors and trying to squash them.
So I thought I would start a discussion to maybe ideate on how to overcome these limitations.
Beta Was this translation helpful? Give feedback.
All reactions