Skip to content

newpathfly/via-public-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

via-public-api

This project contains neccessary classes, enums and interfaces for de-/serialization of VIA public API.

Maven

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>

Bean Validation

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
    ...
}

About

Provides serializable classes for via.com public API, along with best effort validation logics.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages