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

VndErrors logref is not just Integer #1291

Closed
jvalkeal opened this issue May 11, 2020 · 2 comments
Closed

VndErrors logref is not just Integer #1291

jvalkeal opened this issue May 11, 2020 · 2 comments
Assignees
Milestone

Comments

@jvalkeal
Copy link

Looks like constructor is trying to parse Integer out from String:

this(new VndError(message, null, Integer.parseInt(logref), links));

This then for example in a dataflow errors out when trying to upgrade to boot 2.3.x:

java.lang.NumberFormatException: For input string: "NoSuchAppRegistrationException"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:580)
	at java.lang.Integer.parseInt(Integer.java:615)
	at org.springframework.hateoas.mediatype.vnderrors.VndErrors.<init>(VndErrors.java:95)
	at org.springframework.cloud.dataflow.server.controller.RestControllerAdvice.onNotFoundException(RestControllerAdvice.java:163)

At least https://github.com/blongden/vnd.error mentions logref being numeric/alpha/alphanumeric

gregturn added a commit that referenced this issue May 18, 2020
According to https://github.com/blongden/vnd.error, logref is for "expressing a (numeric/alpha/alphanumeric) identifier". This patches `VndError` to support both strings and integers, ensuring each serializes properly.

NOTE: `VndErrors` has been deprecated due to the spec itself being dead since 2014. However, it must be supported until fully removed from Spring HATEOAS.
gregturn added a commit that referenced this issue May 18, 2020
According to https://github.com/blongden/vnd.error, logref is for "expressing a (numeric/alpha/alphanumeric) identifier". This patches `VndError` to support both strings and integers, ensuring each serializes properly.

NOTE: `VndErrors` has been deprecated due to the spec itself being dead since 2014. However, it must be supported until fully removed from Spring HATEOAS.
@gregturn
Copy link
Contributor

@odrotbohm @jvalkeal I've coded a patch against master branch for 1.2. We probably have to backport it to 1.1, 1.0. and 0.25.

@odrotbohm
Copy link
Member

After investigating this a bit more in detail, it looks like the change made for #775 caused the constructor argument incompatibly change from String to Integer. That change was released in 1.1 M1, and Spring Boot 2.3 eventually. So everyone using this API trying to upgrade to Spring Boot 2.3 is going to run into this issue. I'll consult with the Boot team about the fix to make this work again causing a breaking API change. If they don't object, I'd back-port this to 1.1.x for inclusion in the next Boot 2.3 as well.

@odrotbohm odrotbohm self-assigned this Jul 27, 2020
odrotbohm pushed a commit that referenced this issue Jul 27, 2020
According to https://github.com/blongden/vnd.error, logref is for "expressing a (numeric/alpha/alphanumeric) identifier". This patches `VndError` to support both strings and integers, ensuring each serializes properly.

NOTE: `VndErrors` has been deprecated due to the spec itself being dead since 2014. However, it must be supported until fully removed from Spring HATEOAS.

Original pull request: #1293.
odrotbohm added a commit that referenced this issue Jul 27, 2020
odrotbohm pushed a commit that referenced this issue Jul 27, 2020
According to https://github.com/blongden/vnd.error, logref is for "expressing a (numeric/alpha/alphanumeric) identifier". This patches `VndError` to support both strings and integers, ensuring each serializes properly.

NOTE: `VndErrors` has been deprecated due to the spec itself being dead since 2014. However, it must be supported until fully removed from Spring HATEOAS.

Backport of: #1291.
Original pull request: #1293.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants