Skip to content

Colander missing=drop + Sphinx (via cornice-autodoc) result in 'not JSON serializable' while building docs #315

@evgenyz

Description

@evgenyz

When building docs with Sphinx I got:

Exception occurred:
  File "/usr/lib64/python3.4/json/encoder.py", line 173, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <colander._drop object at 0x7f1cfc41ceb8> is not JSON serializable

The problem part is missing=drop declaration.

   title = SchemaNode(
        String(),
        location="body",
        type='non-empty string',
        missing=drop)

And if you change it to missing=None, problem goes away.

Everything is current from pip (in virtualenv), Python 3.4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions