Skip to content

Properties whose value evaluates to False (e.g., zero) are not serialized if using include_empty_properties=False #84

Description

@apdavison

Example:

In [1]: import openminds.v4 as om
In [2]: obj = om.publications.LivePaperSection(name="test", order=0)
In [3]: obj.to_jsonld()
Out[3]:
{'@context': {'@vocab': 'https://openminds.om-i.org/props/'},
 '@type': 'https://openminds.om-i.org/types/LivePaperSection',
 'description': None,
 'isPartOf': None,
 'name': 'test',
 'order': 0,
 'type': None}
In [4]: obj.to_jsonld(include_empty_properties=False)
Out[4]:
{'@context': {'@vocab': 'https://openminds.om-i.org/props/'},
 '@type': 'https://openminds.om-i.org/types/LivePaperSection',
 'name': 'test'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions