We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OS: Ubuntu 22.04 Python: 3.10.2 Pulsar: pulsar-client==3.2.0
from pulsar.schema import JsonSchema, Record, Array, String class A(Record): a = String() class B(Record): b = Array(Array(A())) # Decode JSON data json_data = '{"b": [[{"a": "hello world"}]]}' decoded_data = JsonSchema(B).decode(json_data) # Access the nested objects nested_objects = decoded_data.b[0][0] print(type(nested_objects)) print(nested_objects.a)
<__main__.A object at 0x7fd1ecd07d00> hello world
<class 'dict'> Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'dict' object has no attribute 'a'
The text was updated successfully, but these errors were encountered:
If it's intended, can someone indicate me how to achieve my goal. If it's not intended, probably the unit test should include this. Thanks a lot !
Sorry, something went wrong.
No branches or pull requests
Version
OS: Ubuntu 22.04
Python: 3.10.2
Pulsar: pulsar-client==3.2.0
Minimal reproduce step
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: