All Projects → hdpe → bowman

hdpe / bowman

Licence: Apache-2.0 license
A Java library for accessing a JSON+HAL REST API

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to bowman

mezzio-hal
Hypertext Application Language implementation for PHP and PSR-7
Stars: ✭ 19 (-57.78%)
Mutual labels:  hal
browser
A HAL browser middleware for node.js
Stars: ✭ 39 (-13.33%)
Mutual labels:  hal
oanda api
A ruby client for the Oanda REST API.
Stars: ✭ 35 (-22.22%)
Mutual labels:  rest-client
Eqmac
macOS System-wide Audio Equalizer & Volume Mixer 🎧
Stars: ✭ 3,947 (+8671.11%)
Mutual labels:  hal
Springfox
Automated JSON API documentation for API's built with Spring
Stars: ✭ 5,449 (+12008.89%)
Mutual labels:  spring-data-rest
Kreya
Kreya is a GUI client for gRPC and REST APIs with innovative features for environments, authorizations and more.
Stars: ✭ 217 (+382.22%)
Mutual labels:  rest-client
STM32 HAL FREEMODBUS RTU
FreeMODBUS RTU port for STM32 HAL library
Stars: ✭ 111 (+146.67%)
Mutual labels:  hal
FluentRest
Lightweight fluent wrapper over HttpClient to make REST calls easier
Stars: ✭ 54 (+20%)
Mutual labels:  rest-client
acfs
API client for services
Stars: ✭ 13 (-71.11%)
Mutual labels:  rest-client
hal stm32
No description or website provided.
Stars: ✭ 56 (+24.44%)
Mutual labels:  hal
Core
The server component of API Platform: hypermedia and GraphQL APIs in minutes
Stars: ✭ 2,004 (+4353.33%)
Mutual labels:  hal
spring-jpa-hibernate-mysql-example
Spring Data JPA with Hibernate using MySql Example
Stars: ✭ 24 (-46.67%)
Mutual labels:  spring-data-rest
Rump
REST client for Java that allows for easy configuration and default values. Allows for quick request construction and a huge range of modifications by using response/request interceptors, adjusting default values related to HTTP requests and creating custom instances for when you need multiple API connection setups.
Stars: ✭ 55 (+22.22%)
Mutual labels:  rest-client
hal-api
Enhances your HATEOAS experience by automating common tasks.
Stars: ✭ 32 (-28.89%)
Mutual labels:  hal
php-serializer
Serialize PHP variables, including objects, in any format. Support to unserialize it too.
Stars: ✭ 47 (+4.44%)
Mutual labels:  hal
halfred
A parser for application/hal+json
Stars: ✭ 44 (-2.22%)
Mutual labels:  hal
machinekit-hal
Universal framework for machine control based on Hardware Abstraction Layer principle
Stars: ✭ 89 (+97.78%)
Mutual labels:  hal
camunda-client-go
Camunda REST API client for golang
Stars: ✭ 95 (+111.11%)
Mutual labels:  rest-client
restio
HTTP Client for Dart inspired by OkHttp
Stars: ✭ 46 (+2.22%)
Mutual labels:  rest-client
restish
Restish is a CLI for interacting with REST-ish HTTP APIs with some nice features built-in
Stars: ✭ 453 (+906.67%)
Mutual labels:  rest-client

Bowman

bowman badge bowman client

Bowman is a Java library for accessing a JSON+HAL REST API.

Features

  • Simplified API consumption via automatic, lazy link traversal on an annotated client-side model

  • Tailor made for Spring Data REST

  • Analogous interface to JPA

  • RESTful CRUD and templated link query support

  • Polymorphic deserialisation

Standing on the shoulders of Spring HATEOAS and Jackson.

Usage Example

Given the following annotated model objects:

@RemoteResource("/people")
public class Person {

  private URI id;
  private String name;

  public Person() {}
  public Person(String name) { this.name = name; }

  @ResourceId public URI getId() { return id; }
  public String getName() { return name; }
}

and

@RemoteResource("/greetings")
public class Greeting {

  private URI id;
  private Person recipient;
  private String message;

  public Greeting() {}
  public Greeting(String message, Person recipient)
    { this.message = message; this.recipient = recipient; }

  @ResourceId public URI getId() { return id; }
  @LinkedResource public Person getRecipient() { return recipient; }
  public String getMessage() { return message; }
}

Client instances can be constructed and used as demonstrated below.

The HTTP requests/responses corresponding to each instruction are shown in a comment beneath.

ClientFactory factory = Configuration.builder().setBaseUri("http://...").build()
    .buildClientFactory();

Client<Person> people = factory.create(Person.class);
Client<Greeting> greetings = factory.create(Greeting.class);

URI id = people.post(new Person("Bob"));
// POST /people {"name": "Bob"}
//  -> Location: http://.../people/1

Person recipient = people.get(id);
// GET /people/1
//  -> {"name": "Bob", "_links": {"self": {"href": "http://.../people/1"}}}

assertThat(recipient.getName(), is("Bob"));

id = greetings.post(new Greeting("hello", recipient));
// POST /greetings {"message": "hello", "recipient": "http://.../people/1"}}
//  -> Location: http://.../greetings/1

Greeting greeting = greetings.get(id);
// GET /greetings/1
//  -> {"message": "hello", "_links": {"self": {"href": "http://.../greetings/1"},
// 			"recipient": {"href": "http://.../people/1"}}}

assertThat(greeting.getMessage(), is("hello"));

recipient = greeting.getRecipient();
// GET /people/1
//  -> {"name": "Bob", "_links": {"self": {"href": {"http://.../people/1"}}}

assertThat(recipient.getName(), is("Bob"));

Contributing

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].