Schema Profile

Scott Smith edited this page Nov 14, 2013 · 1 revision

The core of a schema is the object that complies with the JSON Schema spec. But since all PMP documents are Collection.Doc+JSON media type, this schema is wrapped inside a Collection.Doc+JSON document.

Profile Definition

{
  "version": "1.0"
, "attributes": {
    "guid": "1ad1ce7c-2e9d-4b9e-be90-a27e36dec8b2"
  , "title": "Schema Profile"
  , "valid": {
      "from": "2013-02-11T13:21:31.598Z"
    , "to": "3013-05-11T13:21:31.598Z"
    }
  }
, "links": {
    "profile": [
      {
        "href": "https://api.pmp.io/profiles/schema"
      }
    ]
  , "documentation": [
      {
        "href": "https://github.com/publicmediaplatform/pmpdocs/wiki/Schema-Profile"
      , "type": "text/html"
      }
    ]
  , "schema": [
      {
        "href": "https://api.pmp.io/schemas/schema"
      , "scope": "update"
      }
    ]
  , "alternate": [
      {
        "href": "http://api.pmp.io/profiles/schema"
      }
    ]
  }
}

Example Document

{
  "version" : "1.0"
, "attributes" : {  
    "guid"        : "e93add88-b505-42c0-bcfb-fc9efddd4eba"
  , "title"       : "Story Schema"
  , "valid"       : { "from" : "2013-02-11T13:21:31.598Z"
                    , "to"   : "3013-05-11T13:21:31.598Z"}
  , "schema"      : { "$schema": "http://json-schema.org/draft-04/schema#"
                    , "id": "${HOSTNAME}/schemas/story"
                    , "type": "object"
                    , "allOf": [ { "$ref": "https://api.pmp.io/schemas/base" }
                               , { "$ref": "#storySchema" } ]
                    , "definitions": { "storySchema": { "id": "#storySchema"
                                                      , "description": "Story profile definition" }
                                   }}}
, "links" : {
    "profile"      : [ { "href" : "http://api.pmp.io/profiles/schema" } ]
  , "alternate"    : [ { "href" : "http://api.pmp.io/schemas/story" } ]
  
  }  
, "error" : {OBJECT}
}

Fields

  • schema - required. The JSON Schema compliant schema object.