From 4ed7271b1eca560fbad60c240cad23e85ac286f8 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 29 Jun 2012 10:36:01 +0200 Subject: o Adding examples from the specification. --- .../examples/from-spec/collection.collection+json | 66 ++++++++++++++++++++++ public/examples/from-spec/error.collection+json | 12 ++++ public/examples/from-spec/item.collection+json | 26 +++++++++ public/examples/from-spec/minimal.collection+json | 7 +++ public/examples/from-spec/queries.collection+json | 14 +++++ public/examples/from-spec/template.collection+json | 15 +++++ 6 files changed, 140 insertions(+) create mode 100644 public/examples/from-spec/collection.collection+json create mode 100644 public/examples/from-spec/error.collection+json create mode 100644 public/examples/from-spec/item.collection+json create mode 100644 public/examples/from-spec/minimal.collection+json create mode 100644 public/examples/from-spec/queries.collection+json create mode 100644 public/examples/from-spec/template.collection+json (limited to 'public/examples/from-spec') diff --git a/public/examples/from-spec/collection.collection+json b/public/examples/from-spec/collection.collection+json new file mode 100644 index 0000000..db57931 --- /dev/null +++ b/public/examples/from-spec/collection.collection+json @@ -0,0 +1,66 @@ +{ "collection" : + { + "version" : "1.0", + "href" : "http://example.org/friends/", + + "links" : [ + {"rel" : "feed", "href" : "http://example.org/friends/rss"} + ], + + "items" : [ + { + "href" : "http://example.org/friends/jdoe", + "data" : [ + {"name" : "full-name", "value" : "J. Doe", "prompt" : "Full Name"}, + {"name" : "email", "value" : "jdoe@example.org", "prompt" : "Email"} + ], + "links" : [ + {"rel" : "blog", "href" : "http://examples.org/blogs/jdoe", "prompt" : "Blog"}, + {"rel" : "avatar", "href" : "http://examples.org/images/jdoe", "prompt" : "Avatar", "render" : "image"} + ] + }, + + { + "href" : "http://example.org/friends/msmith", + "data" : [ + {"name" : "full-name", "value" : "M. Smith", "prompt" : "Full Name"}, + {"name" : "email", "value" : "msmith@example.org", "prompt" : "Email"} + ], + "links" : [ + {"rel" : "blog", "href" : "http://examples.org/blogs/msmith", "prompt" : "Blog"}, + {"rel" : "avatar", "href" : "http://examples.org/images/msmith", "prompt" : "Avatar", "render" : "image"} + ] + }, + + { + "href" : "http://example.org/friends/rwilliams", + "data" : [ + {"name" : "full-name", "value" : "R. Williams", "prompt" : "Full Name"}, + {"name" : "email", "value" : "rwilliams@example.org", "prompt" : "Email"} + ], + "links" : [ + {"rel" : "blog", "href" : "http://examples.org/blogs/rwilliams", "prompt" : "Blog"}, + {"rel" : "avatar", "href" : "http://examples.org/images/rwilliams", "prompt" : "Avatar", "render" : "image"} + ] + } + ], + + "queries" : [ + {"rel" : "search", "href" : "http://example.org/friends/search", "prompt" : "Search", + "data" : [ + {"name" : "search", "value" : ""} + ] + } + ], + + "template" : { + "data" : [ + {"name" : "full-name", "value" : "", "prompt" : "Full Name"}, + {"name" : "email", "value" : "", "prompt" : "Email"}, + {"name" : "blog", "value" : "", "prompt" : "Blog"}, + {"name" : "avatar", "value" : "", "prompt" : "Avatar"} + + ] + } + } +} diff --git a/public/examples/from-spec/error.collection+json b/public/examples/from-spec/error.collection+json new file mode 100644 index 0000000..bd67e3e --- /dev/null +++ b/public/examples/from-spec/error.collection+json @@ -0,0 +1,12 @@ +{ "collection" : + { + "version" : "1.0", + "href" : "http://example.org/friends/", + + "error" : { + "title" : "Server Error", + "code" : "X1C2", + "message" : "The server have encountered an error, please wait and try again." + } + } +} diff --git a/public/examples/from-spec/item.collection+json b/public/examples/from-spec/item.collection+json new file mode 100644 index 0000000..8f93af6 --- /dev/null +++ b/public/examples/from-spec/item.collection+json @@ -0,0 +1,26 @@ +{ "collection" : + { + "version" : "1.0", + "href" : "http://example.org/friends/", + + "links" : [ + {"rel" : "feed", "href" : "http://example.org/friends/rss"}, + {"rel" : "queries", "href" : "http://example.org/friends/?queries"}, + {"rel" : "template", "href" : "http://example.org/friends/?template"} + ], + + "items" : [ + { + "href" : "http://example.org/friends/jdoe", + "data" : [ + {"name" : "full-name", "value" : "J. Doe", "prompt" : "Full Name"}, + {"name" : "email", "value" : "jdoe@example.org", "prompt" : "Email"} + ], + "links" : [ + {"rel" : "blog", "href" : "http://examples.org/blogs/jdoe", "prompt" : "Blog"}, + {"rel" : "avatar", "href" : "http://examples.org/images/jdoe", "prompt" : "Avatar", "render" : "image"} + ] + } + ] + } +} diff --git a/public/examples/from-spec/minimal.collection+json b/public/examples/from-spec/minimal.collection+json new file mode 100644 index 0000000..2e2e65d --- /dev/null +++ b/public/examples/from-spec/minimal.collection+json @@ -0,0 +1,7 @@ +{ "collection" : + { + "version" : "1.0", + + "href" : "http://example.org/friends/" + } +} diff --git a/public/examples/from-spec/queries.collection+json b/public/examples/from-spec/queries.collection+json new file mode 100644 index 0000000..1a3227d --- /dev/null +++ b/public/examples/from-spec/queries.collection+json @@ -0,0 +1,14 @@ +{ "collection" : + { + "version" : "1.0", + "href" : "http://example.org/friends/", + + "queries" : [ + {"rel" : "search", "href" : "http://example.org/friends/search", "prompt" : "Search" + "data" : [ + {"name" : "search", "value" : ""} + ] + } + ] + } +} diff --git a/public/examples/from-spec/template.collection+json b/public/examples/from-spec/template.collection+json new file mode 100644 index 0000000..df16225 --- /dev/null +++ b/public/examples/from-spec/template.collection+json @@ -0,0 +1,15 @@ +{ "collection" : + { + "version" : "1.0", + "href" : "http://example.org/friends/", + + "template" : { + "data" : [ + {"name" : "full-name", "value" : "", "prompt" : "Full Name"}, + {"name" : "email", "value" : "", "prompt" : "Email"}, + {"name" : "blog", "value" : "", "prompt" : "Blog"}, + {"name" : "avatar", "value" : "", "prompt" : "Avatar"} + ] + } + } +} -- cgit v1.2.3