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

JSON reader fails in case of empty extern field #581

Closed
mikir opened this issue Apr 2, 2024 · 0 comments
Closed

JSON reader fails in case of empty extern field #581

mikir opened this issue Apr 2, 2024 · 0 comments
Assignees
Labels
bug Something isn't working c++ C++ language generator java Java language generator python Python language generator
Milestone

Comments

@mikir
Copy link
Contributor

mikir commented Apr 2, 2024

What version of Zserio and what language are you using?
Zserio: 2.13.0
Language: Python, Java, C++

Describe the bug
If JSON file contains empty extern field, e.g.

"myExternData": {
                    "buffer": [
                    ],
                    "bitSize": 0
                }

the JSON reader in Python throws exception:

zserio.exception.PythonRuntimeException: JsonReader: Unexpected end in Bit Buffer!

To Reproduce
Just create schema with empty extern field, write it to JSON and read it again.

Expected behavior
No exception.

Additional context:
When an arbitrary entry in the extern data buffer is added (to buffer array) leaving the bitsize=0, then everything works fine. The same problem is for C++ and Java.

@mikir mikir added bug Something isn't working python Python language generator labels Apr 2, 2024
@mikir mikir added this to the 2.14 milestone Apr 2, 2024
@mikir mikir changed the title Python: JSON reader fails in case of empty extern field JSON reader fails in case of empty extern field Apr 2, 2024
@mikir mikir added java Java language generator c++ C++ language generator labels Apr 2, 2024
@mikir mikir self-assigned this Apr 2, 2024
@mikir mikir closed this as completed Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working c++ C++ language generator java Java language generator python Python language generator
Projects
None yet
Development

No branches or pull requests

1 participant