Closed InnocentRoot closed 3 years ago
Hi, thank you for this library.
It is possible to use jsonapi-converter to serialize a Type to JSON?
Example
From:
public class Gear { @Id private String id; @JsonProperty("tooth-count") private Long toothCount; @JsonProperty("tooth-depth") private Long toothDepth; }
To:
{ "data": [ { "id": "1", "type": "gears", "attributes": { "tooth-count": 13, "tooth-depth": 21 } } ] }
Hello,
Once you have ResourceConverter instance you can do:
ResourceConverter
String json = new String(converter.writeDocument(documentHoldingYourGearInstance), StandardCharsets.UTF_8);
It works,
Thanks
Hi, thank you for this library.
It is possible to use jsonapi-converter to serialize a Type to JSON?
Example
From:
To: