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

Enum serialization bug with jackson-2.7.5 #258

Open
viruscamp opened this issue Jul 6, 2016 · 1 comment
Open

Enum serialization bug with jackson-2.7.5 #258

viruscamp opened this issue Jul 6, 2016 · 1 comment

Comments

@viruscamp
Copy link

viruscamp commented Jul 6, 2016

I am using this cool lib.
After I update some lib to new versions, I met a bug.

lightadmin-1.2.0.RC1
spring-data-rest-webmvc-2.2.4.RELEASE instead of 2.2.2.RELEASE
jackson-*-2.7.5 instead of 2.4.5

The js request such rest service lightadmin/rest/schoolClasses/metadata
and get this response, which should contains "listView" : { ... },

{
  "name" : "my.package.entity.Student",
  "managed_type" : true,
  ...
  "dynamic_properties" : {
    "LIST_VIEW" : { ... },
    "FORM_VIEW" : { ... }
  }
}

Add a custom serializer for DomainConfigurationUnitType to resolve it.
Or configure jackson ObjectMapper like this.
org.lightadmin.core.config.context.LightAdminRepositoryRestMvcConfiguration.configureJacksonObjectMapper

protected void configureJacksonObjectMapper(ObjectMapper objectMapper) {
    objectMapper.configure(SerializationFeature.WRITE_ENUMS_USING_TO_STRING, true);
    objectMapper.configure(DeserializationFeature.READ_ENUMS_USING_TO_STRING, true);
    objectMapper.registerModule(new LightAdminJacksonModule(globalAdministrationConfiguration()));
}
@viruscamp
Copy link
Author

This affects jackson after 2.6.2

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

1 participant