Skip to content
New issue

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

Extra propertyValue after object property #6

Open
e-tobi opened this issue Sep 9, 2023 · 1 comment
Open

Extra propertyValue after object property #6

e-tobi opened this issue Sep 9, 2023 · 1 comment

Comments

@e-tobi
Copy link

e-tobi commented Sep 9, 2023

When having a json like:

{"id":\"foo", "aaa": {}}

the sequence of events is:

  • JsonEventType.propertyName : id
  • JsonEventType.propertyValue : foo
  • JsonEventType.propertyName : aaa
  • JsonEventType.beginObject : null
  • JsonEventType.endObject : null
  • JsonEventType.propertyValue : null
  • JsonEventType.endObject : null

I guess the last propertyValue shouldn't be there.

@aeb-dev
Copy link
Owner

aeb-dev commented Sep 10, 2023

It actually has a purpose. The reason is propertyValue: value actaully marks the end of property. So if this project was not about streaming the event would be propertyValue: {}. But the object could be huge so I don't want to store it to allocate things unnecessarily. Therefore, instead of returning something I just return propertyValue: null to mark end of property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants