schematics/schematics

Define JsonType

matusbarabas opened this issue · 5 comments

Can someone help me how to create new JsonType ? My column in databese has json type value.

Can you explain more? What type i should use ? My custom or BaseType? and why i have to call to_primitive function?

class CreateRequest(Model):
    id: IntType = IntType(required=False)
    param: StringType = StringType(validators=[json_validator])

This is model, which I used. So, I have to change StringType to Model like this?

class CreateRequest(Model):
    id: IntType = IntType(required=False)
    param: Model

And where to use json dumps method. It is still not clear for me.