This project contains neccessary classes, enums and interfaces for de-/serialization of VIA public API.
Maven package can be found on Maven Central.
To add it as a dependency to your project, include following in the <dependencies>
section in the pom.xml
along with properiate version number.
<dependency>
<groupId>com.newpathfly</groupId>
<artifactId>via-public-api</artifactId>
<version><!-- version number --></version>
</dependency>
Each class comes with bean validation constraints which could be used for request and response validation before proceeding with the actual logic.
To enable bean validation in your project, in the code add lines like below:
import com.via.api.model.Search;
import com.via.api.utils.ModelValidator;
...
Search.Request request = someMethodThatReturnsSearchRequest();
try {
new ModelValidator().validate(request);
} catch (IllegalArgumentException e) {
// request is invalid
...
}