johnbeynon/stash-api

View on GitHub
docs/schema/api.json

Summary

Maintainability
Test Coverage
{
  "$schema": "http://interagent.github.io/interagent-hyper-schema",
  "type": [
    "object"
  ],
  "definitions": {
    "collection": {
      "$schema": "http://json-schema.org/draft-04/hyper-schema",
      "title": "Collections",
      "definitions": {
        "id": {
          "description": "unique identifier of collection",
          "example": "01234567-89ab-cdef-0123-456789abcdef",
          "format": "uuid",
          "type": [
            "string"
          ]
        },
        "name": {
          "description": "Name of the collection",
          "example": "My Collection",
          "type": [
            "string"
          ]
        },
        "identity": {
          "$ref": "#/definitions/collection/definitions/id"
        },
        "created_at": {
          "description": "when collection was created",
          "example": "2012-01-01T12:00:00Z",
          "format": "date-time",
          "type": [
            "string"
          ]
        },
        "updated_at": {
          "description": "when collection was updated",
          "example": "2012-01-01T12:00:00Z",
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "description": "Collections are buckets for storing your resources in",
      "links": [
        {
          "description": "Create a new collection.",
          "href": "/collections",
          "method": "POST",
          "rel": "create",
          "schema": {
            "properties": {
              "name": {
                "$ref": "#/definitions/collection/definitions/name"
              }
            },
            "type": [
              "object"
            ],
            "required": [
              "name"
            ]
          },
          "title": "Create"
        },
        {
          "description": "Delete an existing collection.",
          "href": "/collections/{(%23%2Fdefinitions%2Fcollection%2Fdefinitions%2Fidentity)}",
          "method": "DELETE",
          "rel": "destroy",
          "title": "Delete"
        },
        {
          "description": "Info for existing collection.",
          "href": "/collections/{(%23%2Fdefinitions%2Fcollection%2Fdefinitions%2Fidentity)}",
          "method": "GET",
          "rel": "self",
          "title": "Info"
        },
        {
          "description": "List existing collections.",
          "href": "/collections",
          "method": "GET",
          "rel": "instances",
          "title": "List"
        },
        {
          "description": "Update an existing collection.",
          "href": "/collections/{(%23%2Fdefinitions%2Fcollection%2Fdefinitions%2Fidentity)}",
          "method": "PATCH",
          "rel": "update",
          "schema": {
            "properties": {
              "name": {
                "$ref": "#/definitions/collection/definitions/name"
              }
            },
            "type": [
              "object"
            ]
          },
          "title": "Update"
        }
      ],
      "properties": {
        "created_at": {
          "$ref": "#/definitions/collection/definitions/created_at"
        },
        "id": {
          "$ref": "#/definitions/collection/definitions/id"
        },
        "name": {
          "$ref": "#/definitions/collection/definitions/name"
        },
        "updated_at": {
          "$ref": "#/definitions/collection/definitions/updated_at"
        }
      },
      "type": [
        "object"
      ]
    },
    "resource": {
      "$schema": "http://json-schema.org/draft-04/hyper-schema",
      "title": "Resource",
      "definitions": {
        "id": {
          "description": "unique identifier of resource",
          "example": "01234567-89ab-cdef-0123-456789abcdef",
          "format": "uuid",
          "type": [
            "string"
          ]
        },
        "title": {
          "description": "title of resource",
          "example": "A title",
          "type": [
            "string"
          ]
        },
        "url": {
          "description": "URL of the resource",
          "example": "http://www.somedomain.com",
          "type": [
            "string"
          ]
        },
        "domain": {
          "description": "Extracted domain from URL",
          "example": "somedomain.com",
          "readOnly": true,
          "type": [
            "string"
          ]
        },
        "identity": {
          "$ref": "#/definitions/resource/definitions/id"
        },
        "created_at": {
          "description": "when resource was created",
          "example": "2012-01-01T12:00:00Z",
          "format": "date-time",
          "type": [
            "string"
          ]
        },
        "updated_at": {
          "description": "when resource was updated",
          "example": "2012-01-01T12:00:00Z",
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "tags": {
          "description": "Tags",
          "type": [
            "array"
          ],
          "items": {
            "type": [
              "object"
            ]
          }
        }
      },
      "description": "FIXME",
      "links": [
        {
          "description": "Delete an existing resource.",
          "href": "/resources/{(%23%2Fdefinitions%2Fresource%2Fdefinitions%2Fidentity)}",
          "method": "DELETE",
          "rel": "destroy",
          "title": "Delete"
        },
        {
          "description": "Info for existing resource.",
          "href": "/resources/{(%23%2Fdefinitions%2Fresource%2Fdefinitions%2Fidentity)}",
          "method": "GET",
          "rel": "self",
          "title": "Info"
        },
        {
          "description": "Update an existing resource.",
          "href": "/resources/{(%23%2Fdefinitions%2Fresource%2Fdefinitions%2Fidentity)}",
          "method": "PATCH",
          "rel": "update",
          "schema": {
            "properties": {
            },
            "type": [
              "object"
            ]
          },
          "title": "Update"
        },
        {
          "description": "List resources in a collection.",
          "href": "/collections/{(%23%2Fdefinitions%2Fcollection%2Fdefinitions%2Fidentity)}/resources",
          "method": "GET",
          "rel": "instances",
          "title": "Collection resources"
        },
        {
          "description": "Add a new resource in a collection.",
          "href": "/collections/{(%23%2Fdefinitions%2Fcollection%2Fdefinitions%2Fidentity)}/resources",
          "method": "POST",
          "rel": "create",
          "schema": {
            "properties": {
              "url": {
                "$ref": "#/definitions/resource/definitions/url"
              },
              "title": {
                "$ref": "#/definitions/resource/definitions/title"
              },
              "tags": {
                "$ref": "#/definitions/resource/definitions/tags"
              }
            },
            "type": [
              "object"
            ],
            "required": [
              "url"
            ]
          },
          "title": "Create resource"
        }
      ],
      "properties": {
        "created_at": {
          "$ref": "#/definitions/resource/definitions/created_at"
        },
        "id": {
          "$ref": "#/definitions/resource/definitions/id"
        },
        "title": {
          "$ref": "#/definitions/resource/definitions/title"
        },
        "url": {
          "$ref": "#/definitions/resource/definitions/url"
        },
        "domain": {
          "$ref": "#/definitions/resource/definitions/domain"
        },
        "updated_at": {
          "$ref": "#/definitions/resource/definitions/updated_at"
        },
        "tags": {
          "$ref": "#/definitions/resource/definitions/tags"
        }
      },
      "type": [
        "object"
      ]
    },
    "tag": {
      "$schema": "http://json-schema.org/draft-04/hyper-schema",
      "title": "Tag",
      "definitions": {
        "id": {
          "description": "unique identifier of tag",
          "example": "01234567-89ab-cdef-0123-456789abcdef",
          "format": "uuid",
          "type": [
            "string"
          ]
        },
        "identity": {
          "$ref": "#/definitions/tag/definitions/id"
        },
        "name": {
          "description": "Name of the tag",
          "example": "A Tag",
          "type": [
            "string"
          ]
        },
        "slug": {
          "description": "Generated slug of the tag",
          "example": "a-tag",
          "type": [
            "string"
          ]
        }
      },
      "description": "FIXME",
      "links": [
        {
          "description": "Create a new tag.",
          "href": "/tags",
          "method": "POST",
          "rel": "create",
          "schema": {
            "properties": {
            },
            "type": [
              "object"
            ],
            "required": [
              "name"
            ]
          },
          "title": "Create"
        },
        {
          "description": "Delete an existing tag.",
          "href": "/tags/{(%23%2Fdefinitions%2Ftag%2Fdefinitions%2Fidentity)}",
          "method": "DELETE",
          "rel": "destroy",
          "title": "Delete"
        },
        {
          "description": "Info for existing tag.",
          "href": "/tags/{(%23%2Fdefinitions%2Ftag%2Fdefinitions%2Fidentity)}",
          "method": "GET",
          "rel": "self",
          "title": "Info"
        },
        {
          "description": "List existing tags.",
          "href": "/tags",
          "method": "GET",
          "rel": "instances",
          "title": "List"
        },
        {
          "description": "Update an existing tag.",
          "href": "/tags/{(%23%2Fdefinitions%2Ftag%2Fdefinitions%2Fidentity)}",
          "method": "PATCH",
          "rel": "update",
          "schema": {
            "properties": {
            },
            "type": [
              "object"
            ]
          },
          "title": "Update"
        },
        {
          "description": "Tags in collection.",
          "href": "/collections/{(%23%2Fdefinitions%2Fcollection%2Fdefinitions%2Fidentity)}/tags",
          "method": "GET",
          "rel": "instances",
          "title": "Lists"
        }
      ],
      "properties": {
        "id": {
          "$ref": "#/definitions/tag/definitions/id"
        },
        "name": {
          "$ref": "#/definitions/tag/definitions/name"
        },
        "slug": {
          "$ref": "#/definitions/tag/definitions/slug"
        }
      },
      "type": [
        "object"
      ]
    }
  },
  "properties": {
    "collection": {
      "$ref": "#/definitions/collection"
    },
    "resource": {
      "$ref": "#/definitions/resource"
    },
    "tag": {
      "$ref": "#/definitions/tag"
    }
  },
  "description": "Stash API.",
  "id": "stash-api",
  "links": [
    {
      "href": "https://api.stash.com",
      "rel": "self"
    }
  ],
  "title": "Stash API"
}