skip to Main Content

Json – parse generic sealed class in kotlin using jackson

I have the following generic sealed class representing the status of network response. @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "status") @JsonSubTypes( value = [ JsonSubTypes.Type(value = Response.OK::class, name = "OK"), JsonSubTypes.Type(value = Response.Error::class, name = "ERROR"), ] )…

VIEW QUESTION

Redis – Why does ResponseBody and Jackson ObjectMapper don't return the same output?

I am using a Spring Boot application. I have a method in my controller that returns some Resources: @ResponseBody @Transactional(rollbackFor = Exception.class) @GetMapping(value="data/{itemId}/items", produces="application/json") public Resources<DataExcerpt> listMyData(@PathVariable("debateId") UUID debateId)){ List<DataExcerpt> dataExcerpts = dataService .listMyData(id) .stream() .map(d -> this.projectionFactory.createProjection(DataExcerpt.class, d)) .collect(Collectors.toList());…

VIEW QUESTION

Redis – Deserialize class with @AutoValue annotation during getting from cache in SpringBoot application

I've created a value class with com.google.auto.value.AutoValue annotation: @AutoValue @JsonDeserialize(builder = AutoValue_Company.Builder.class) public abstract class Company { public static Builder newBuilder() { return new AutoValue_Company.Builder(); } @JsonProperty("id") public abstract long id(); @JsonProperty("description") public abstract String description(); @JsonProperty("websiteUrl") public abstract String…

VIEW QUESTION
Back To Top
Search