Skip to content

Instantly share code, notes, and snippets.

@geraintluff
Last active December 25, 2015 14:09
Show Gist options
  • Save geraintluff/6988554 to your computer and use it in GitHub Desktop.
Save geraintluff/6988554 to your computer and use it in GitHub Desktop.
{
"title": "Ellipsis",
"description": "Placeholder for items that are not present in a preview list, but are expected to be present in the actual list.",
"type": "object",
"properties": {
"...": {
"type": ["integer", "null"],
"minimum": 1
},
"total": {
"type": "integer",
"minimum": 0
}
},
"required": ["..."]
}
@geraintluff
Copy link
Author

Example uses (inside other objects):

{
    "project": "My Killer App",
    "git": "git://some/url.git",
    "contributors": [
        {"name": "Prolific Programmer", "url": "/users/prolific-programmer/"},
        {"name": "Sometimes Sam", "url": "/users/sometimes-sam/"},
        {"...": 15}
    ]
}
{
    "name": "Famous Reindeer Teams",
    "teams": [
        {
            "name": "Father Christmas's Sleigh Team",
            "url": "/teams/reindeer/father-christmas",
            "preview": [
                {"...": null, "total": 9},
                "Dasher",
                {"...": null},
                "Rudolph"
            ]
        }
    ]
}

The idea is that positional information can included in the preview - we know that the previewed contributers are the first two in the list, and that Rudolph is the last reindeer. However, we do not know the position of "Dasher" within the list.

A client can use this information to represent the previews in a meaningful way, e.g.:

Contributors:
    1. Prolific Programmer
    2. Sometimes Sam
    [show 15 more]
Famous Reindeer Teams:

    [Father Christmas's Sleigh Team]: 9 reindeer, including Dasher and Rudolph

@geraintluff
Copy link
Author

Note that this would be intended for use in combination with a rel="full" link.

In the above examples, there is presumably a rel="full" link for the "contributers" property, and a link for each entry in the "teams" array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment