grantwwu commented on issue #4004: Allow for a more lenient decoder for json 
schemas
URL: https://github.com/apache/pulsar/pull/4004#issuecomment-480975005
 
 
   Porting some comments I had from the Slack here:
   
   I personally do not think Pulsar should allow unquoted property names in the 
JSON schema by default. [1]
   
   Unquoted field names break many standard JSON parsers.  For example, 
Python's `import json` and recent browser's `JSON.parse` both reject unquoted 
property names.  If we allow unquoted property names, then consumers will need 
to code defensively and possibly pull in a third party dependency to get a more 
lenient parser.  For example, this breaks the Python client: 
https://github.com/apache/pulsar/blob/master/pulsar-client-cpp/python/pulsar/schema/schema.py#L86
   
   [1] I would not be opposed to having it be tunable, but I think it's not 
really best practice to allow invalid JSON into a system that's claiming it's 
JSON.  Probably the JSON should be validated/and-or cleaned up at ingestion - 
possibly with another topic and a Pulsar Function.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to