0

I just switched from flaks_restplus to flask_restx. I start getting the marshal error.

jsonschema.exceptions.ValidationError: None is not of type 'object'

I defined this field in my modal, and the dict I passed in.

"my_field": fields.Raw

{... 'my_field': None}

How can I allow None for the field?

etlds
  • 5,810
  • 2
  • 23
  • 30

1 Answers1

0

I guess I found the answer. The field I defined is wrapped in field.Nested()

I have to pass in the optional parameter field.Nested(myModel, skip_none=True)

It is not intuitive...

etlds
  • 5,810
  • 2
  • 23
  • 30