You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2019/04/12 00:09:28 UTC
[pulsar] branch master updated: Handle subrecords in JsonSchema
encoding (#4023)
This is an automated email from the ASF dual-hosted git repository.
mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new c92d4e0 Handle subrecords in JsonSchema encoding (#4023)
c92d4e0 is described below
commit c92d4e0551a783a2626aff8628fa2958dfd40fe7
Author: Yoann Ciabaud <yc...@users.noreply.github.com>
AuthorDate: Fri Apr 12 02:09:21 2019 +0200
Handle subrecords in JsonSchema encoding (#4023)
---
pulsar-client-cpp/python/pulsar/schema/schema.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pulsar-client-cpp/python/pulsar/schema/schema.py b/pulsar-client-cpp/python/pulsar/schema/schema.py
index 91250a8..260d7b0 100644
--- a/pulsar-client-cpp/python/pulsar/schema/schema.py
+++ b/pulsar-client-cpp/python/pulsar/schema/schema.py
@@ -80,7 +80,7 @@ class JsonSchema(Schema):
def encode(self, obj):
self._validate_object_type(obj)
- return json.dumps(obj.__dict__, indent=True).encode('utf-8')
+ return json.dumps(obj.__dict__, default=lambda o: o.__dict__, indent=True).encode('utf-8')
def decode(self, data):
return self._record_cls(**json.loads(data))