{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "additionalProperties": false,
    "definitions": {
        "contributor": {
            "additionalProperties": false,
            "description": "A contributor to a story (creator or editor).",
            "properties": {
                "contributorId": {
                    "description": "Unique identifier.",
                    "type": "string"
                },
                "email": {
                    "_format": "email",
                    "type": "string"
                },
                "itemRole": {
                    "description": "Contribution in relation to this piece of content.",
                    "type": "string"
                },
                "name": {
                    "description": "First and last name, as it appears in the byline.",
                    "type": "string"
                },
                "role": {
                    "description": "Creator's position at the news organization.",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "location": {
            "additionalProperties": false,
            "description": "The location of the content.",
            "properties": {
                "city": {
                    "type": "string"
                },
                "country": {
                    "type": "string"
                },
                "latitude": {
                    "type": "number"
                },
                "longitude": {
                    "type": "number"
                },
                "state": {
                    "type": "string"
                }
            },
            "type": "object"
        },
        "mediaObject": {
            "additionalProperties": false,
            "description": "A generic container for a media object.",
            "properties": {
                "caption": {
                    "type": "string"
                },
                "creators": {
                    "items": {
                        "$ref": "#/definitions/contributor"
                    },
                    "type": "array"
                },
                "location": {
                    "$ref": "#/definitions/location"
                },
                "url": {
                    "type": "string"
                }
            },
            "type": "object"
        }
    },
    "description": "A story to be pushed to the Washington Post's WebSked planning tool.",
    "properties": {
        "analytics": {
            "additionalProperties": false,
            "description": "Contains various analytics information about the story.",
            "properties": {
                "comments": {
                    "description": "Number of comments the story has received.",
                    "type": "integer"
                },
                "pageViews": {
                    "type": "integer"
                },
                "shares": {
                    "description": "The number of times the story has been shared on various social media networks.",
                    "properties": {
                        "facebook": {
                            "type": "integer"
                        },
                        "googlePlus": {
                            "type": "integer"
                        },
                        "twitter": {
                            "type": "integer"
                        }
                    },
                    "type": "object"
                }
            },
            "type": "object"
        },
        "cms": {
            "description": "The name of the CMS from which the story originated.",
            "type": "string"
        },
        "cmsEditURL": {
            "_format": "uri",
            "description": "URL to open the story for editing in the CMS' web client.",
            "type": "string"
        },
        "contentType": {
            "description": "Content type of the story (eg, article, video, gallery).",
            "enum": [
                "article",
                "video",
                "gallery",
                "graphic",
                "image"
            ]
        },
        "creators": {
            "description": "Various information about the creators and contributors to a story.",
            "items": {
                "$ref": "#/definitions/contributor"
            },
            "type": "array"
        },
        "custom": {
            "description": "Organizations can use fields within custom to track data that is not captured in the WebSked data specification, but is relevant to their needs.",
            "properties": {},
            "type": "object"
        },
        "dates": {
            "additionalProperties": false,
            "description": "Various RFC3339-formatted datetimes associated with the story.",
            "properties": {
                "created": {
                    "_format": "date-time",
                    "description": "The RFC3339-formatted datetime at which the story was created in the CMS.",
                    "type": "string"
                },
                "planned": {
                    "description": "The RFC3339-formatted datetime at which the reporter expects the story to be ready, or null if this is still unknown. This is only an estimate and can be modified later.",
                    "_format": "date-time",
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "published": {
                    "_format": "date-time",
                    "description": "The RFC3339-formatted datetime at which the story was published on the web.",
                    "type": "string"
                },
                "scheduled": {
                    "_format": "date-time",
                    "description": "The RFC3339-formatted datetime at which the story will go live, if one has been determined.",
                    "type": "string"
                },
                "updated": {
                    "_format": "date-time",
                    "description": "The RFC3339-formatted datetime at which the story was last updated in the CMS.",
                    "type": "string"
                }
            },
            "required": [
                "created",
                "updated",
                "planned"
            ],
            "type": "object"
        },
        "editors": {
            "description": "Array containing information about each of the story's editors.",
            "items": {
                "$ref": "#/definitions/contributor"
            },
            "type": "array"
        },
        "headline": {
            "type": "string"
        },
        "html": {
            "description": "The actual content of the story, in HTML format.",
            "type": "string"
        },
        "id": {
            "description": "Immutable ID created in the CMS.",
            "type": "string"
        },
        "location": {
            "$ref": "#/definitions/location"
        },
        "media": {
            "additionalProperties": false,
            "description": "Contains information about the various media associated with the story.",
            "properties": {
                "galleries": {
                    "description": "An array of the galleries associated with this story.",
                    "items": {
                        "$ref": "#/definitions/mediaObject"
                    },
                    "type": "array"
                },
                "graphics": {
                    "description": "An array of the graphics associated with this story.",
                    "items": {
                        "$ref": "#/definitions/mediaObject"
                    },
                    "type": "array"
                },
                "images": {
                    "description": "An array of the images associated with this story.",
                    "items": {
                        "$ref": "#/definitions/mediaObject"
                    },
                    "type": "array"
                },
                "videos": {
                    "description": "An array of the videos associated with this story.",
                    "items": {
                        "$ref": "#/definitions/mediaObject"
                    },
                    "type": "array"
                },
                "willHaveGalleries": {
                    "description": "Whether or not the reporter anticipates that the story will have galleries.",
                    "type": "boolean"
                },
                "willHaveGraphics": {
                    "description": "Whether or not the reporter anticipates that the story will have graphics.",
                    "type": "boolean"
                },
                "willHaveImages": {
                    "description": "Whether or not the reporter anticipates that the story will have images.",
                    "type": "boolean"
                },
                "willHaveVideos": {
                    "description": "Whether or not the reporter anticipates that the story will have videos.",
                    "type": "boolean"
                }
            },
            "type": "object"
        },
        "originatingPlan": {
            "description": "The plan path from which the story originated.",
            "type": "string"
        },
        "plans": {
            "description": "An array of plan paths to which the story belongs.",
            "items": {
                "type": "string"
            },
            "type": "array"
        },
        "slug": {
            "description": "A short string by which to easily identify the story.",
            "type": "string"
        },
        "source": {
            "description": "The source of the content.",
            "type": "string"
        },
        "status": {
            "additionalProperties": false,
            "description": "Contains information about the current status of the story.",
            "properties": {
                "live": {
                    "description": "Whether or not the story is live on the web.",
                    "type": "boolean"
                },
                "publish": {
                    "description": "Denotes which of a number of organization-defined publish statuses the story is currently in.",
                    "type": "integer"
                },
                "publishRaw": {
                    "description": "The raw publish status from the CMS.",
                    "type": "string"
                },
                "workflow": {
                    "description": "Denotes which of a number of organization-defined workflow statuses the story is currently in.",
                    "type": "integer"
                },
                "workflowRaw": {
                    "description": "The raw workflow status from the CMS.",
                    "type": "string"
                }
            },
            "required": [
                "publish",
                "workflow",
                "live"
            ],
            "type": "object"
        },
        "storyLength": {
            "additionalProperties": false,
            "properties": {
                "actual": {
                    "description": "Current number of words.",
                    "type": "integer"
                },
                "planned": {
                    "description": "The anticipated number of words in the story.",
                    "type": "integer"
                }
            },
            "type": "object"
        },
        "summary": {
            "description": "A short summary of the story to be displayed in WebSked.",
            "type": "string"
        },
        "url": {
            "_format": "uri",
            "description": "Web URL for published stories.",
            "type": "string"
        },
        "usage": {
            "description": "Contains information about where and when the story has been used.",
            "items": {
                "additionalProperties": false,
                "properties": {
                    "endTime": {
                        "description": "Epoch time when the story was removed from this location.",
                        "type": "integer"
                    },
                    "locationId": {
                        "description": "Unique number for the location.",
                        "type": "integer"
                    },
                    "locationName": {
                        "description": "Human-readable location.",
                        "type": "string"
                    },
                    "startTime": {
                        "description": "Epoch time when the story went live at this location.",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "type": "array"
        }
    },
    "required": [
        "id",
        "status",
        "contentType",
        "dates",
        "plans",
        "originatingPlan",
        "creators",
        "html",
        "headline"
    ],
    "title": "WebSked Story",
    "type": "object"
}