docs: def to_json(value, **kwargs):
          """Return value, serialized if value is a HasProperties instance"""
          if isinstance(value, HasProperties):
              return value.serialize(**kwargs)
          return value