-
Notifications
You must be signed in to change notification settings - Fork 117
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
Deserialize Duration from int-like String (e.g. "3600") #232
Comments
PS. I came across this because there is a certain OAuth provider that does not conform to the rfc an sends the |
Thanks, though from a quick look at the code, looks like this should work. Therefore adding the 'test-needed', can be added to the "failing" package for now. Perhaps there's a config flag that needs to be set? |
Ok, I think I see the issue now.. an int-like String isn't supported, since the code directly uses the
Therefore, there are actually checks in place to ensure the So double minus points on the OAuth provider for not specifying the proper
Therefore, an argument could be made that the OAuth provider needs to fix their code, IMO. All that said, I don't see why the |
Unfortunately This does not mean that |
FWTW, newly (2.16) added
enabling of which would allow interpretation of "stringified" numbers as suggested. |
I think even after #184 and related changes this is still not possible.
Trying to parse a string
"3600"
into a Duration field results in an exception: "Text cannot be parsed to a Duration"I've tried adding
@JsonFormat("SECONDS")
but it seems this only applies to numeric input.This behaviour is inconsistent with other parts of Jackson:
"not_before": "1442340812"
) to an Instant,"expires_in": "3600"
) to a DurationIt would be nice if the handling for
@JsonFormat
also applied to int-like Strings, not only to actual NumbersThe text was updated successfully, but these errors were encountered: