Skip to content

EmbeddedMapper private but used in public constructor #433

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

Closed
drdamour opened this issue Feb 4, 2016 · 6 comments
Closed

EmbeddedMapper private but used in public constructor #433

drdamour opened this issue Feb 4, 2016 · 6 comments

Comments

@drdamour
Copy link

drdamour commented Feb 4, 2016

https://github.com/spring-projects/spring-hateoas/blob/master/src/main/java/org/springframework/hateoas/hal/Jackson2HalModule.java#L121

having a tough time working with this new serializer, this one in particular is difficult...how can i create my own embedded mapper?

@gregturn
Copy link
Contributor

gregturn commented Mar 5, 2019

Existing media types aren't really designed for external usage. It's primarily to support HAL-FORMS (and other tentative HAL extensions), which is in another package as well as the other modules of Spring HATEOAS that need to instantiate things.

That being said, we have designed an SPI to register your own media types. See #833.

@gregturn gregturn closed this as completed Mar 5, 2019
@drdamour
Copy link
Author

drdamour commented Mar 5, 2019

that's too bad because the existing one has no way to force a single link to be represented as a link array with a single entry in the output json..so if you add a second link later clients that are tightly coupled to the json contract complain that an object became an array.

@odrotbohm
Copy link
Member

@drdamour – Would you mind checking the options available on HalConfiguration? There are plenty of ways to define whether links shall be rendered as arrays. As of 1.0 M1 even on a per link relation basis.

@drdamour
Copy link
Author

drdamour commented Mar 5, 2019

hey look at

RenderSingleLinks getSingleLinkRenderModeFor(LinkRelation relation) {
that's very handy! guess i need to RTFM (again).

thanks

@odrotbohm
Copy link
Member

odrotbohm commented Mar 5, 2019

It's pretty new, so don't be too harsh on yourself 🙃. Happy coding!

@drdamour
Copy link
Author

drdamour commented Mar 5, 2019

yeah if you added support for #175 i could use the OOTB one

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

3 participants