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

Add forward compatibility to TaggedFieldSerializer #352

Closed
causis opened this issue Oct 1, 2015 · 7 comments
Closed

Add forward compatibility to TaggedFieldSerializer #352

causis opened this issue Oct 1, 2015 · 7 comments

Comments

@causis
Copy link

causis commented Oct 1, 2015

Hello, how do you do?
I was wondering why TaggedFieldSerializer doesn't have a configuration like jackson's "FAIL_ON_UNKNOWN_PROPERTIES". It seems that it would be an easy way to add forward compatibility on demand, and I think the only piece of code that would need to be changed is:

if (cachedField == null) 
  throw new KryoException("Unknown field tag: " + tag + " (" + getType().getName() + ")");

This would give us more flexibility, specially when 2 different apps are used to serialize and deserialize the object.
It would also allow to avoid having to declare deprecated fields, although this could be a dangerous practice, leading to forgetting and reusing a tag.
Thank you very much!

@psmarcos
Copy link

psmarcos commented Oct 1, 2015

+1

@magro
Copy link
Collaborator

magro commented Oct 2, 2015

Pull requests welcome! :-)

Am 01.10.2015 21:41 schrieb "Pablo Marcos" notifications@github.com:

+1


Reply to this email directly or view it on GitHub.

@causis
Copy link
Author

causis commented Oct 2, 2015

Great! I'll work on it and send it!
Thanks!

@levyfan
Copy link

levyfan commented Nov 10, 2015

Hi, I have just sent a pull request. Could you please help review it?

@fgaule
Copy link

fgaule commented Feb 11, 2016

Would be great to have this feature soon 👍

magro added a commit that referenced this issue Apr 10, 2016
Add forward compatibility to TaggedFieldSerializer in issue #352.
@magro
Copy link
Collaborator

magro commented Apr 10, 2016

Resolved with #365

@magro magro closed this as completed Apr 10, 2016
@cypherdare
Copy link
Contributor

cypherdare commented Jul 8, 2016

@levyfan Could you explain why the fields need to be written in tag value order? (Maybe just to make reading faster?) And I don't see where or how the unknown bytes of the future tagged field are skipped in the Input. Thanks.

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

No branches or pull requests

6 participants