Jackson Starter
The Jackson Starter provides a convenient wrapper around the Jackson Module
Project Dependencies
Add the following dependency to your pom.xml/build.gradle file:
implementation("com.raynigon.unit-api:jackson-starter:1.1.7")
<dependency>
<groupId>com.raynigon.unit-api</groupId>
<artifactId>jackson-starter</artifactId>
<version>1.1.7</version>
</dependency>
Configuration
The Unit-Api Jackson Starter can be configured with Spring Configuration. The root key is spring.jackson.unit-api
.
Options
Key | Values | Description |
---|---|---|
spring.jackson.unit-api.features.SYSTEM_UNIT_ON_MISSING_ANNOTATION | true, false | If no Annotation is present and the given input is a number, the system unit for this quantity should be used. |
Usage
To enable the SYSTEM_UNIT_ON_MISSING_ANNOTATION
feature add the following line in your application.properties
:
spring.jackson.unit-api.features.SYSTEM_UNIT_ON_MISSING_ANNOTATION=true