-
Notifications
You must be signed in to change notification settings - Fork 472
Bug when serializing resources with HalEmbeddedBuilder #88
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
items to embedded collections.
embedded collections.
There is another bug occurring when serializing a Resources collection containing mixed resource types. The appropriate JsonSerializer instance in OptionalListJackson2Serializer was retrieved only for the first element's type and then cached for the whole process. I pushed a another commit fixing this issue. |
@olivergierke can we merge this soon? |
please. i need this. its critical for my project -_- |
@olivergierke //inside HypermediaSupportBeanDefinitionRegistrar registerWithGeneratedName(new RootBeanDefinition(Jackson2ModuleRegisteringBeanPostProcessor.class), registry);//inside serializer HalEmbeddedBuilder builder = new HalEmbeddedBuilder(relProvider);thus i am not able to replace the HalEmbeddedBuilder with a customized or "corrected" version as a "user" |
@@ -366,7 +373,8 @@ private void serializeContents(Iterator<?> value, JsonGenerator jgen, Serializer | |||
*/ | |||
@Override | |||
public JsonSerializer<?> getContentSerializer() { | |||
return serializer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that make sense here? It seems we're now arbitrarily picking a serializer to return it, don't we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say that it is just as "random" as it was befor (the type of the first item is not less random)
@gregorriegler Let's try to keep tickets focused on a single change (SRP). Feel free to open a new one and suggest changes. |
@olivergierke good point. yes, of course. ill might even do that in the near future ;-) |
i believe this can be closed |
This is working in current versions. |
I encountered a bug in HalEmbeddedBuilder. Adding more than 2 values with the same reltype to an embedded collection will result in somthing like this:
A fourth item would be merged with the single
listItem
and then replace the collection and so on...