You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
Through browsing the issues I found out about the ability to define a coercer & type-checker which can then be registered with typic.register. I think i have mostly figured out how to use this, but it would be useful if there was some documentation about it and how it can be used.
I would be very willing to open a PR myself but I don't think I fully understand the API.
Also wanted to say i think typical is great, thanks for the wonderful library!
The text was updated successfully, but these errors were encountered:
Thanks for the call out on this one, looks like the documentation was dropped when the library was migrated to hand-written docs instead of auto-generated. That being said, I've hoped to add a more wholistic way to define custom serializers at a part of #72, and ideally drop this function eventually.
As it is, the API is quite simple, you register your type by providing a callable which takes a type and checks whether it is your target type, and a deserializer which will be responsible for converting an input into your type.
Thanks for the reply and the extremely clear example, it has really helped me and hope it will help others in a similar situation. I saw #72 and it looks like a great idea!
Would you find it helpful if I opened a PR for documentation? I'm always glad to help.
Description
In the documentation under the warning about handling unions it is specified that to handle unions we have to define a custom converter, however the link in the documentation goes nowhere.
Through browsing the issues I found out about the ability to define a coercer & type-checker which can then be registered with
typic.register
. I think i have mostly figured out how to use this, but it would be useful if there was some documentation about it and how it can be used.I would be very willing to open a PR myself but I don't think I fully understand the API.
Also wanted to say i think typical is great, thanks for the wonderful library!
The text was updated successfully, but these errors were encountered: