Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
<version>1.1.0.BUILD-SNAPSHOT</version>
<version>1.1.0.HATEOAS-1260-SNAPSHOT</version>

<name>Spring HATEOAS</name>
<url>https://github.com/spring-projects/spring-hateoas</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
import java.util.List;

import org.springframework.hateoas.config.HypermediaMappingInformation;
import org.springframework.hateoas.mediatype.MessageResolver;
import org.springframework.hateoas.mediatype.hal.CurieProvider;
import org.springframework.hateoas.mediatype.hal.Jackson2HalModule;
import org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalHandlerInstantiator;
import org.springframework.hateoas.server.core.EvoInflectorLinkRelationProvider;
import org.springframework.http.MediaType;

import com.fasterxml.jackson.databind.DeserializationFeature;
Expand Down Expand Up @@ -47,6 +52,9 @@ public List<MediaType> getMediaTypes() {
@Override
public ObjectMapper configureObjectMapper(ObjectMapper mapper) {

mapper.registerModule(new Jackson2HalModule());
mapper.setHandlerInstantiator(new HalHandlerInstantiator(new EvoInflectorLinkRelationProvider(),
CurieProvider.NONE, MessageResolver.DEFAULTS_ONLY));
mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
mapper.enable(SerializationFeature.INDENT_OUTPUT);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name" : "Frodo Baggins",
"role" : "ring bearer",
"links" : [ {
"rel" : "self",
"href" : "http://localhost/employees/1"
} ]
}
"_links" : {
"self" : {
"href" : "http://localhost/employees/1"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name" : "Frodo Baggins",
"role" : "ring bearer",
"links" : [ {
"rel" : "self",
"href" : "http://localhost/employees/1"
} ]
}
"_links" : {
"self" : {
"href" : "http://localhost/employees/1"
}
}
}