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 enum features into @JsonFormat.Feature #3637

Closed
Anatoly4444 opened this issue Oct 19, 2022 · 7 comments
Closed

Add enum features into @JsonFormat.Feature #3637

Anatoly4444 opened this issue Oct 19, 2022 · 7 comments
Labels
good first issue Issue that seems easy to resolve and is likely a good candidate for contributors new to project pr-welcome Issue for which progress most likely if someone submits a Pull Request
Milestone

Comments

@Anatoly4444
Copy link

Anatoly4444 commented Oct 19, 2022

com.fasterxml.jackson.annotation

I have several enum objects which jackson deserialize and requests failed after third company API updated possible values in this object. And also i don't want to add this Feature for whole project cause this feature could broke logic for another requests.

Jackson has com.fasterxml.jackson.annotation.JsonFormat.Feature which could be added on certain class but for now that does not support READ_UNKNOWN_ENUM_VALUES_AS_NULL and READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE. Please add

@cowtowncoder said i should create issue here, not in jackson-annotations

@Anatoly4444 Anatoly4444 added the to-evaluate Issue that has been received but not yet evaluated label Oct 19, 2022
@cowtowncoder
Copy link
Member

Thank you @Anatoly4444 -- yes, this is slightly better place since support must be added here too; and adding entries in jackson-annotations can be done as part of implementation (filing separate issue only when working on making things work).

@cowtowncoder cowtowncoder added 2.15 and removed to-evaluate Issue that has been received but not yet evaluated labels Oct 23, 2022
@cowtowncoder cowtowncoder added good first issue Issue that seems easy to resolve and is likely a good candidate for contributors new to project pr-welcome Issue for which progress most likely if someone submits a Pull Request labels Dec 2, 2022
@cowtowncoder
Copy link
Member

Adding labels to indicate that help would be welcome here, and that I think this is relatively straight-forward to implement.

@cowtowncoder cowtowncoder changed the title Add enum features into JsonFormat.Feature Add enum features into @JsonFormat.Feature Jan 20, 2023
@cowtowncoder cowtowncoder added this to the 2.15.0 milestone Jan 20, 2023
@cowtowncoder
Copy link
Member

Merged, to be included in 2.15.0. Thank you for the contribution @Siwach16!

@hrishikeshakolkar
Copy link

Hello, i am upgrading my work project to jackson version 2.15.0 to fix vulnerabilities, and have received below error.
Need help... :(

org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoSuchFieldError: READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1082)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:655)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
.............

@JooHyukKim
Copy link
Member

@hrishikeshakolkar please provide error report/reproduction with Jackson content "without" springframework 👍🏻. Or can you try to file a report at org.springframework.web?

@cowtowncoder
Copy link
Member

@hrishikeshakolkar You seem to have version incompatibility between what framework expects (was compiled against) and what is deployed: specifically you likely have jackson-databind version older than what is needed.
But like @JooHyukKim said, this is something wrt your deployment or framework; not something Jackson project can help with.

@hrishikeshakolkar
Copy link

Sure will check.. thanks people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issue that seems easy to resolve and is likely a good candidate for contributors new to project pr-welcome Issue for which progress most likely if someone submits a Pull Request
Projects
None yet
Development

No branches or pull requests

4 participants