Closed Hamcker closed 5 years ago
I guess this won't fix, as the class specified in a schema always needs to be instantiable in order to be deserializable.
Not always, but thanks to this library, I made a full-feautered serializer library for this.
great, feel free to submit a PR here if it helps
Attempting to create
ModelSchema
viacreateModelSchema
for abstract classes causesArgument of type 'typeof Foo' is not assignable to parameter of type 'Clazz'.
Cannot assign an abstract constructor type to a non-abstract constructor type.
the complete code is something like this:
abstract class Foo { bar: string = 'bar' } const FooSchema = createModelSchema(Foo, {bar: primitive()});