Questions tagged [collection-json]

Collection+json is a hypermedia format used to manage collections and items in a REST api. The format details how data and operations on them can be represented.

Questions about this tag should be about getting help in representing resources with this format.

The complete specification is at this address: http://amundsen.com/media-types/collection/

Here is the main git repo with the work-in-progress draft of collection+json, cj clients, and proposed extensions to the format: https://github.com/collection-json

A good number of examples and a more in-depth description of the format can be found in Mike Amundsens' book Restful Web Apis http://restfulwebapis.com/

See also https://stackoverflow.com/tags/hypermedia/info for a general definition of hypermedia.

7 questions
5
votes
1 answer

HATEOAS and forms driven by the API

I'm trying to apply HATEOAS to the existing application and I'm having trouble with modeling a form inputs that would be driven by the API response. The app is allowing to search & book connections between two places. First endpoint allows for…
4
votes
3 answers

Reading CollectionJson content in Web Api Project

I have a project similar(Almost identical) to Conference API project which is taking similar approach to the noted project for returning CollectionJson content. I am having difficulty Setting the Collection property of the ReadDocument (Line 30) as…
MHOOS
  • 5,146
  • 11
  • 39
  • 74
1
vote
1 answer

collection+json where an item has associations

I am considering using the collection+json media type in a project. However, after reading the docs I can't figure out what's the deal with items that have associations. Given this items list, what should I do if I also need to list, i. ex., a list…
1
vote
2 answers

Collection+JSON items that link to other collection's items

I am doing a REST web server in nodejs and I was thinking to implement it using Collection+JSON as hypermedia-type. However I did not understand if it is possible to represent in the collection 1 to n relationships. So if for example I have a…
Michel Uncini
  • 321
  • 1
  • 14
1
vote
1 answer

Nested Collection+JSON Hypermedia Type Example

The examples for Collection+JSON do not show examples of nested collections. Can anyone point to an example of Collection+JSON using nested collections or describe an experience where they had success. For example, would this work for a top level…
Michael Allan Jackson
  • 4,217
  • 3
  • 35
  • 45
0
votes
1 answer

How to do json schema validation on collection+json objects?

I would like to validate collection+json objects with schema that have different formats under the same array. For example: { "href": "https://example.com/whatnot", "data": [ { "name": "foo", "value":…
Squrppi
  • 95
  • 1
  • 7
0
votes
2 answers

Why does collection+json use anonymous objects instead of key value pairs

I'm trying to find a data schema which can be used for different scenaries and a promissing format I found so far is the collection+json format (http://amundsen.com/media-types/collection/ ). So far it has a lot of the functionallity I need and is…
Stefan
  • 14,826
  • 17
  • 80
  • 143