How do I define classes for this JSON?

https://pastebin.com/P13GjAGy My JSON is at that link. It's too long to be posted here. I created an ArrayList of type Binding(class) in a class Result. And in Binding, I have objects of type Symbol, Open, High, Close, etc. In them I have Strings ...
more »

2017-12-03 23:12 (0) Answers

Java Jackson writeAsString conversion

using Java8 with jackson I have code convert A class into json String, which works fine, i have Scenario where if i want values of rate1 and rate2 to be blank string if certain values. I am wondering if there is quick and easy way to do it ? @...
more »

2017-12-01 18:12 (1) Answers

Adding content property to serialization

Whenever I use a custom serializer in spring data rest, it adds a "content" property that wrapps the object returned, like: { "content":{ object properties... }, _links: { } } EDIT: Add configuration class @Configuration public ...
more »

2017-11-30 19:11 (1) Answers

Mapping json to multiple Pojo classes

So I'm working on a project for a Java class and I need to fetch weather data. I'm using the weather underground api. I haven't really learned yet how to do APIs so I'm self taught. I've gotten a location API working by using JsonSchemaToPojo to cre...
more »

2017-11-29 21:11 (0) Answers

How to create a JsonNode chaining two arrays?

I'm building a complex JSON object with Jackson and I want to structure the code to display the JSON structure clearly, so I'm trying to use the JsonNode API with chained with, put and set methods. At one place inside all this chained stuff I need to...
more »

2017-11-28 13:11 (1) Answers

Parsing Yaml in Java

I have the following YAML I want to parse using Jackson parser in Java. android: "7.0": - nexus - S8 "6.0": - s7 - g5 ios: "10.0": - iphone 7 - iphone 8 I created a created class which ha...
more »

2017-11-27 22:11 (2) Answers

When is a JsonNode instance null?

Consider the following Java class definition. CrudOperation.java: package com.cyberfront.test.json.nll.demonstration; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fas...
more »

2017-11-25 07:11 (1) Answers

Java - Class<? extends Collection>

I would like to add multiple class in below jackson deserialize. But how do i do that? below is the sample code. XmlMapper mapper = new XmlMapper(); JaxbAnnotationModule module = new JaxbAnnotationModule(); mapper.registerModule(module); AnnotationI...
more »

2017-11-23 16:11 (1) Answers

Only add type information when deserializing

I'm currently producing JSON to a JMS queue. I'd like to add some type info when serializing the object, which I did with the following annotations: @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @J...
more »

2017-11-23 13:11 (0) Answers