deepkit-framework
                                
                                 deepkit-framework copied to clipboard
                                
                                    deepkit-framework copied to clipboard
                            
                            
                            
                        Custom converter and validators for a type
This is like a continuation from my question in https://github.com/super-hornet/super-hornet.ts/issues/12#issuecomment-663155896.
Looking at the source code I figured out a way to to add custom converter compilers to specifics types:
https://gist.github.com/leandro-manifesto/cac78114030756383462b6c7b641aaf2#file-register-ts
It works by overring the default plain -> class and class -> plain converter compilers and the default class checker compiler, but I get the feeling that it can break at any moment if internals change.
Would be nice if a feature like this was provided by Marshal itself.
I see, yes indeed the internals might change and we could add instead a simpler API for adding checkers/serializers for simple class types.
Here is an example that shows how a custom class type can be de/serialised: https://github.com/deepkit/deepkit-framework/blob/master/packages/type/tests/serializer-api.spec.ts#L48-L64
I'll close this issue since I don't see anything we can do.