Skip to content

Instantly share code, notes, and snippets.

@maggandalf
Last active August 29, 2015 14:03
Show Gist options
  • Save maggandalf/3fd4ab1302d2d5f932b3 to your computer and use it in GitHub Desktop.
Save maggandalf/3fd4ab1302d2d5f932b3 to your computer and use it in GitHub Desktop.
@Singleton
@Path("bookinfo")
public class BookInfoService {
@GET
@Path("{isbn}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public JsonObject findBookByISBN(@PathParam("isbn") String isbn) {
return Json.createObjectBuilder()
.add("author", "George R.R. Martin")
.add("isbn", "1111")
.add("title", "A Game Of Thrones").build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment