From 7bb8d75fcb6813f19972e971abe8bb387c210b69 Mon Sep 17 00:00:00 2001 From: Behrang Saeedzadeh Date: Mon, 20 Mar 2017 14:28:38 +1100 Subject: [PATCH] #555 - Fixed syntax highlighting in the reference guide. Fixed syntax highlighting. Fixed code block indentation. Added the missing leading underscore in the example "_link" output. Added missing quotes to JSON code blocks. --- src/main/asciidoc/index.adoc | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/main/asciidoc/index.adoc b/src/main/asciidoc/index.adoc index 83558be8..d7e5baa7 100644 --- a/src/main/asciidoc/index.adoc +++ b/src/main/asciidoc/index.adoc @@ -62,11 +62,18 @@ resource.add(new Link("http://myhost/people")); This would render as follows in JSON: -[source, xml] +[source, json] ---- -{ firstname : "Dave", - lastname : "Matthews", - links : [ { rel : "self", href : "http://myhost/people" } ] } +{ + "firstname" : "Dave", + "lastname" : "Matthews", + _"links" : [ + { + "rel" : "self", + "href" : "http://myhost/people" + } + ] +} ---- … or slightly more verbose in XML … @@ -192,6 +199,7 @@ So far we have created links by pointing to the web-framework implementations (i The `EntityLinks` interface now exposes an API to lookup a `Link` or `LinkBuilder` based on the model types. The methods essentially return links to either point to the collection resource (e.g. `/people`) or a single resource (e.g. `/people/1`). +[source, java] ---- EntityLinks links = …; LinkBuilder builder = links.linkFor(CustomerResource.class); @@ -330,20 +338,20 @@ public class Config { Note that now the prefix `ex:` automatically appears before all rels which are not registered with IANA, as in `ex:orders`. Clients can use the `curies` link to resolve a curie to its full form: -[source, java] +[source, json] ---- { - _links : { - self: { href: "http://myhost/person/1" }, - curies: { - name: "ex", - href: "http://example.com/rels/{rel}", - templated: true + _"links" : { + "self" : { href: "http://myhost/person/1" }, + "curies" : { + "name" : "ex", + "href" : "http://example.com/rels/{rel}", + "templated" : true }, - "ex:orders" : { href: "http://myhost/person/1/orders" } + "ex:orders" : { href : "http://myhost/person/1/orders" } }, - firstname : "Dave", - lastname : "Matthews" + "firstname" : "Dave", + "lastname" : "Matthews" } ----