Skip to content

WebConnector: REST Mapping

Jasper Nalbach edited this page Oct 5, 2016 · 5 revisions

This page refers to las2peer versions older than 0.6.1!

The WebConnector uses the REST Mapper to map service method to a REST API. As a service developer you have to do the following steps:

  • Inherit from the RESTService class instead from the Service class
  • Annotate your service using annotations

Annotations

Services are identified by the first path segment. That means, services paths cannot share a common path prefix. Also, a @Path annotation at class level is now required.

Versioned endpoints

All service methods are available at paths beginning with /service/.... In this case, any service version can be called (probably a newer one). You can also specify a version using /service/v{serviceIdentifier}/..., where {serviceIdentifier} is replaced by a version as described here.

Also, the version determined using the same algorithm used for remote method invocations. That means that you should specify the version so that all service versions provide the same REST API. To make this manageable, we encourage every service to use semantic versioning.

Clone this wiki locally