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

Unable to parse arrays except uint8_t #47

Open
m-sasha opened this issue Jun 29, 2020 · 1 comment
Open

Unable to parse arrays except uint8_t #47

m-sasha opened this issue Jun 29, 2020 · 1 comment

Comments

@m-sasha
Copy link
Contributor

m-sasha commented Jun 29, 2020

The generator converts fields of array types, such as uint16_t[6] to a List (in FieldGenerator.arrayType()), however ReflectionPayloadDeserializer.deserialize doesn't have a case for this.

I would also recommend adding a warning print at the end of ReflectionPayloadDeserializer.deserialize if there is no type match, so at least it's made obvious to the user that something is wrong, instead of just having a null field.

@benbarkay
Copy link
Contributor

I've committed code to master that implements serialization/deserialization of List fields, which should now support your case.
I've only tested it in test code, so I am not keen on making a release yet. It would help if you can verify that this works for you, then I will do further testing and make a release for it.

As far as throwing exceptions for this kind of thing, I also thought it was a good idea previously, but then that made the library completely unusable when support for any of the fields are missing (rather than somewhat useful). This is obviously something that should be easy to cover fully, unfortunately I lack the tests and use cases to ensure that nothing has been missed at this time.

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