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

hope to add feature DeserializationFeature.READ_ENUMS_USING_INDEX #149

Closed
chenboxiang opened this issue Jan 16, 2013 · 7 comments
Closed
Milestone

Comments

@chenboxiang
Copy link

I hope to add DeserializationFeature.READ_ENUMS_USING_INDEX. When I enable this config, deserialize enum type property will use enum's ordinal.

@cowtowncoder
Copy link
Member

This should already work, have you tried it? There is a way to disable this (FAIL_ON_NUMBERS_FOR_ENUMS), but by default it should "just work".

@chenboxiang
Copy link
Author

Sorry, I did not describe my problem clearly! if the json value is Integer, it works well. if the json value is String, it will throws an exception.
org.codehaus.jackson.map.JsonMappingException: Can not construct instance of com.gozap.labi.serializer.test.Code from String value '1': value not one of declared Enum instance names
I want a feature when I enable it, deserialize will try to convert the json value to Integer first.
My English is not good. I hope you can understand me.

@cowtowncoder
Copy link
Member

Ok, yes I think I understand this. Thank you for clarification.

@chenboxiang
Copy link
Author

Will this feature be added in a new version?

@cowtowncoder
Copy link
Member

Yes if someone spends time implementing it.

@chenboxiang
Copy link
Author

Thank you very much!

@cowtowncoder cowtowncoder added this to the 2.4.0 milestone Mar 17, 2014
cowtowncoder added a commit that referenced this issue Mar 17, 2014
@cowtowncoder
Copy link
Member

Ok good news: I went ahead and implemented this -- no feature needed, quoted numbers can be used without specific configuration now. Will be included in 2.4.0 once it is released.

christophercurrie pushed a commit to christophercurrie/jackson-databind that referenced this issue Jul 19, 2015
JsonParser, ObjectCodec: javadoc: empty docs to return null
@cowtowncoder cowtowncoder modified the milestones: 2.4.0, 2.9.0 Jul 19, 2017
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