Skip to content

Convert link with RFC5988 additional attributes #699

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

Conversation

jtwalraven
Copy link
Contributor

I noticed that the deserialization in the Jackson2HalModule was not working with the additional RFC5988 attributes added in PR #567 . This adds two tests for converting from Json.

Unfortunately, I am having trouble getting media to work. It does not seem to be converted properly using the json parser. I will continue looking into this, but would appreciate one of the maintainers looking it over.

Also, note: I would use one constructor for the link in the deserialization, but it was mentioned in #567 to use Lambok notation. Currently, the constructor containing the attributes is protected and cannot be accessed from the Jackson2HalModule.

Added full conversion into Jackson2HalModule deserialize
@pivotal-issuemaster
Copy link

@jtwalraven Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@jtwalraven Thank you for signing the Contributor License Agreement!

@jtwalraven
Copy link
Contributor Author

This also needs "profile" attribute from: #679

@gregturn
Copy link
Contributor

For starters, "media" is not an attribute in the HAL spec. In general, it can be included as part of RFC5988, meaning it may appear when a Link is rendered as an HTTP header, but it's not for serialization into a HAL document. That's why it's explicitly excluded in org.springframework.hateoas.hal.LInkMixin.

gregturn added a commit that referenced this pull request Feb 19, 2018
@gregturn
Copy link
Contributor

Thanks @jtwalraven!

I took your PR, polished it a little and fixed the test cases.

Resolved at ba1dae3.

@gregturn gregturn closed this Feb 19, 2018
@gregturn gregturn self-assigned this Feb 19, 2018
@gregturn gregturn added this to the 1.0 M1 milestone Feb 19, 2018
@jtwalraven
Copy link
Contributor Author

@gregturn That makes a lot of sense. You're welcome and thanks for explaining/fixing!

@jtwalraven jtwalraven deleted the fix-jackson-attributes-conversion branch February 19, 2018 22:18
@jtwalraven jtwalraven changed the title [WIP] Convert link with RFC5988 additional attributes Convert link with RFC5988 additional attributes Feb 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants