zhavir opened a new issue, #15844:
URL: https://github.com/apache/pulsar/issues/15844

   **Describe the bug**
   If you have a complex schema, the reserved keys `_default`, `_required` and 
`_required_default` are not cleaned up
   
   **To Reproduce**
   Steps to reproduce the behavior:
   ```
   
   
   class SchemaB(Record):
       field = String(required=True)
   
   class SchemaA(Record):
       field = SchemaB()
   
   a = SchemaA(field=SchemaB(field="something"))
   b = JsonSchema(SchemaA).encode(a)
   print(b)
   
   b'{\n "field": {\n  "_required_default": false,\n  "_default": null,\n  
"_required": false,\n  "field": "something"\n }\n}'
   
   ```
   
   
   **Expected behavior**
   reserved keys are cleaned up recursively.
   
   **Desktop (please complete the following information):**
    - MacOS 12.3.1
   
   **Additional context**
   the problem seems to be 
[here](https://github.com/apache/pulsar/blob/master/pulsar-client-cpp/python/pulsar/schema/schema.py#L97).
 The cleanup is not made recursively 
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to