-
Notifications
You must be signed in to change notification settings - Fork 174
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
IPackable/IUnpackable implementations ignored when no fields present #202
Labels
bug
Detected as bug
Comments
Thank you for reporting. It is not an expected behaviour. I agree that the interface methods should be called even the type does not have any members. |
yfakariya
added a commit
that referenced
this issue
Feb 11, 2017
… be serialized. #202 This commit add * Unit tests for new specs. * Relaxes validation to allow types which implement I[Un][Async]Packable fully but have no members. * Add additional validation to check such types implements pair of interfaces or not.
yfakariya
added a commit
that referenced
this issue
Feb 11, 2017
… be serialized. #202 This commit add * Unit tests for new specs. * Relaxes validation to allow types which implement I[Un][Async]Packable fully but have no members. * Add additional validation to check such types implements pair of interfaces or not.
yfakariya
added a commit
that referenced
this issue
Feb 11, 2017
… be serialized. #202 This commit add * Unit tests for new specs. * Relaxes validation to allow types which implement I[Un][Async]Packable fully but have no members. * Add additional validation to check such types implements pair of interfaces or not.
yfakariya
added a commit
that referenced
this issue
Feb 12, 2017
… be serialized. #202 This commit add * Unit tests for new specs. * Relaxes validation to allow types which implement I[Un][Async]Packable fully but have no members. * Add additional validation to check such types implements pair of interfaces or not.
Fixed in f34c23f |
Hi, just to say thank you for fixing this :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hullo,
I am creating a networked application with this library for serialising my packet payloads. Some packets have no payload, which I represent for convenience as an empty dictionary (since all other payloads are encoded as a dictionary).
The problem is that this library does not allow you to serialise/deserialise classes with no fields:
With the class:
This line will throw an exception complaining about a lack of fields to serialise:
Understanding that, whilst I would like for this to work, it may go against the libraries design decisions - I decided to implement IPackable and IUnpackable for SerializeMe:
The library still complains that I have no fields to serialise, even though it shouldn't care as I now provide a manual packable/unpackable interface? I feel like this is unintentional behaviour? Adding a dummy field to SerializeMe causes it to use the IPackable/IUnpackable interface.
I hope I've described the situation adequately, let me know if you need more information :)
The text was updated successfully, but these errors were encountered: