Contribute to help us improve!
Are there edge cases or problems that we didn't consider? Is there a technical pitfall that we should add? Did we miss a comma in a sentence?
If you have any input for us, we would love to hear from you and appreciate every contribution. Our goal is to learn from projects for projects such that nobody has to reinvent the wheel.
Let's collect our experiences together to make room to explore the novel!
To contribute click on Contribute to this page on the toolbar.
JSON
JSON (JavaScript Object Notation) is a format to represent and exchange data in a human readable form. See https://www.json.org/json-en.html for a formal definition. JSON is easier explained here: https://www.w3schools.com/js/js_json_intro.asp.
JSON parser
devonfw recommends FasterXMLs Jackson as JSON parser. There’s a useful series on Jackson on Baeldung: https://www.baeldung.com/jackson
Spring offers a default support for mapping with Jackson, when spring-starter-web is used.
Quarkus offers the following extension:
This extension adds the usual quarkus-resteasy-reactive functionality and adds the mapping using Jackson.
Use ISO8601 in UTC for timestamp representation
It’s recommended to use ISO 8601 as timestamp representation yyyy-MM-dd’T’HH:mm:ssXXX
.
Furthermore, always send timezones in UTC.
This can be achieved on a ZonedDateTime
field with the following annotation:
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXXX", timezone = "UTC", lenient = OptBoolean.TRUE)
Send monetary amounts as separation of amount and currency
Monetary amounts should be best representated as object consisting of the actual amount and the currency.
... "money": { "amount": 200.00, "currency": "USD" }, ...
Zalandos Jackson Datatype Money is a implementation for this.