{
    "definitions": {
        "infection": {
            "$schema": "http://json-schema.org/draft-04/schema",
            "definitions": {
                "created_at": {
                    "description": "when item was created",
                    "type": [
                        "string"
                    ]
                },
                "id": {
                    "description": "unique identifier of infection",
                    "format": "uuid",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "identity": {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/infection/definitions/id"
                        }
                    ]
                },
                "reporter_id": {
                    "description": "unique identifier of item owner",
                    "format": "uuid",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "survivor_id": {
                    "description": "unique identifier of item owner",
                    "format": "uuid",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "updated_at": {
                    "description": "when item was updated",
                    "type": [
                        "string"
                    ]
                }
            },
            "description": "Infection reports of survivors, when a survivor is reported as infected 3 times, he/she is considered a zombie and therefore cannot trade or interact anymore.",
            "links": [
                {
                    "description": "Report another survivor as infected, only works when logged.",
                    "href": "/infections/{(%23%2Fdefinitions%2Finfection%2Fdefinitions%2Fidentity)}",
                    "method": "POST",
                    "rel": "self",
                    "title": "Create"
                }
            ],
            "properties": {
                "created_at": {
                    "$ref": "#/definitions/infection/definitions/created_at"
                },
                "id": {
                    "$ref": "#/definitions/infection/definitions/id"
                },
                "reporter_id": {
                    "$ref": "#/definitions/infection/definitions/reporter_id"
                },
                "survivor_id": {
                    "$ref": "#/definitions/infection/definitions/survivor_id"
                },
                "updated_at": {
                    "$ref": "#/definitions/infection/definitions/updated_at"
                }
            },
            "stability": "prototype",
            "strictProperties": true,
            "title": "Infection",
            "type": [
                "object"
            ]
        },
        "item": {
            "$schema": "http://json-schema.org/draft-04/schema",
            "definitions": {
                "created_at": {
                    "description": "when item was created",
                    "format": "date-time",
                    "type": [
                        "string"
                    ]
                },
                "id": {
                    "description": "unique identifier of item",
                    "format": "uuid",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "identity": {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/item/definitions/id"
                        }
                    ]
                },
                "item_value": {
                    "description": "value of item",
                    "readOnly": true,
                    "type": [
                        "number"
                    ]
                },
                "name": {
                    "description": "unique name of item",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "survivor_id": {
                    "description": "unique identifier of item owner",
                    "format": "uuid",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "updated_at": {
                    "description": "when item was updated",
                    "format": "date-time",
                    "type": [
                        "string"
                    ]
                }
            },
            "description": "Items - Water, food, medicataion or ammunition of a survivor",
            "links": [
                {
                    "description": "Info for existing item.",
                    "href": "/items/{(%23%2Fdefinitions%2Fitem%2Fdefinitions%2Fidentity)}",
                    "method": "GET",
                    "rel": "self",
                    "title": "Info"
                }
            ],
            "properties": {
                "created_at": {
                    "$ref": "#/definitions/item/definitions/created_at"
                },
                "id": {
                    "$ref": "#/definitions/item/definitions/id"
                },
                "item_value": {
                    "$ref": "#/definitions/item/definitions/item_value"
                },
                "name": {
                    "$ref": "#/definitions/item/definitions/name"
                },
                "survivor_id": {
                    "$ref": "#/definitions/item/definitions/survivor_id"
                },
                "updated_at": {
                    "$ref": "#/definitions/item/definitions/updated_at"
                }
            },
            "stability": "prototype",
            "strictProperties": true,
            "title": "Item",
            "type": [
                "object"
            ]
        },
        "survivor": {
            "$schema": "http://json-schema.org/draft-04/schema",
            "definitions": {
                "age": {
                    "description": "age of survivor",
                    "readOnly": false,
                    "type": [
                        "integer"
                    ]
                },
                "created_at": {
                    "description": "when survivor was created",
                    "format": "date-time",
                    "type": [
                        "string"
                    ]
                },
                "gender": {
                    "description": "gender of survivor",
                    "readOnly": false,
                    "type": [
                        "string"
                    ]
                },
                "id": {
                    "description": "unique identifier of survivor",
                    "format": "uuid",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "identity": {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/survivor/definitions/id"
                        },
                        {
                            "$ref": "#/definitions/survivor/definitions/name"
                        }
                    ]
                },
                "infections": {
                    "description": "infections of survivor",
                    "readOnly": false,
                    "type": [
                        "array",
                        "null"
                    ]
                },
                "items": {
                    "description": "items of survivor",
                    "readOnly": true,
                    "type": [
                        "array",
                        "null"
                    ]
                },
                "lat": {
                    "description": "latitude of survivor",
                    "readOnly": false,
                    "type": [
                        "number",
                        "null"
                    ]
                },
                "lng": {
                    "description": "longitude of survivor",
                    "readOnly": false,
                    "type": [
                        "number",
                        "null"
                    ]
                },
                "name": {
                    "description": "unique name of survivor",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "updated_at": {
                    "description": "when survivor was updated",
                    "format": "date-time",
                    "type": [
                        "string"
                    ]
                }
            },
            "description": "User of the system, surviving on the zombie-crawled wasteland. When with pending trades to accept or review a pending_trade HTTP header will be attached to all requests",
            "links": [
                {
                    "description": "Create a new survivor.",
                    "href": "/survivors",
                    "method": "POST",
                    "rel": "create",
                    "schema": {
                        "properties": {},
                        "type": [
                            "null",
                            "object"
                        ]
                    },
                    "title": "Create"
                },
                {
                    "description": "Delete an existing survivor.",
                    "href": "/survivors/{(%23%2Fdefinitions%2Fsurvivor%2Fdefinitions%2Fidentity)}",
                    "method": "DELETE",
                    "rel": "destroy",
                    "title": "Delete"
                },
                {
                    "description": "Info for existing survivor.",
                    "href": "/survivors/{(%23%2Fdefinitions%2Fsurvivor%2Fdefinitions%2Fidentity)}",
                    "method": "GET",
                    "rel": "self",
                    "title": "Info"
                },
                {
                    "description": "List existing survivors.",
                    "href": "/survivors",
                    "method": "GET",
                    "rel": "instances",
                    "title": "List"
                },
                {
                    "description": "Receives reports of population status, including - healthy percentage, infected percentage, and totals",
                    "href": "/reports/status",
                    "method": "GET",
                    "rel": "reports",
                    "title": "Survivors status"
                },
                {
                    "description": "Receives reports of items status, including - Average amount of each kind of resource by survivor (e.g. 5 waters per user) and Points lost because of infected survivor. et. al.\",",
                    "href": "/reports/items",
                    "method": "GET",
                    "rel": "items report",
                    "title": "Items status"
                },
                {
                    "description": "Update an existing survivor.",
                    "href": "/survivors/{(%23%2Fdefinitions%2Fsurvivor%2Fdefinitions%2Fidentity)}",
                    "method": "PATCH",
                    "rel": "update",
                    "schema": {
                        "properties": {},
                        "type": [
                            "null",
                            "object"
                        ]
                    },
                    "title": "Update"
                }
            ],
            "properties": {
                "age": {
                    "$ref": "#/definitions/survivor/definitions/age"
                },
                "created_at": {
                    "$ref": "#/definitions/survivor/definitions/created_at"
                },
                "gender": {
                    "$ref": "#/definitions/survivor/definitions/gender"
                },
                "id": {
                    "$ref": "#/definitions/survivor/definitions/id"
                },
                "infections": {
                    "$ref": "#/definitions/survivor/definitions/infections"
                },
                "items": {
                    "$ref": "#/definitions/survivor/definitions/items"
                },
                "lat": {
                    "$ref": "#/definitions/survivor/definitions/lat"
                },
                "lng": {
                    "$ref": "#/definitions/survivor/definitions/lng"
                },
                "name": {
                    "$ref": "#/definitions/survivor/definitions/name"
                },
                "updated_at": {
                    "$ref": "#/definitions/survivor/definitions/updated_at"
                }
            },
            "stability": "prototype",
            "strictProperties": true,
            "title": "Survivor",
            "type": [
                "object"
            ]
        },
        "trade": {
            "$schema": "http://json-schema.org/draft-04/schema",
            "definitions": {
                "accepted": {
                    "description": "boolean to indicate acceptance of trade by :to recipient",
                    "format": "uuid",
                    "readOnly": true,
                    "type": [
                        "boolean",
                        "null"
                    ]
                },
                "created_at": {
                    "description": "when trade was created",
                    "type": [
                        "string"
                    ]
                },
                "from_items": {
                    "description": "items from the origin of transaction, represented by 'items' array of JSON Item objects",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "id": {
                    "description": "unique identifier of trade",
                    "format": "uuid",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "identity": {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/trade/definitions/id"
                        }
                    ]
                },
                "reviewed": {
                    "description": "boolean to indicate review of trade by 'from' recipient and, after value is set to true it's items are exchanged",
                    "format": "uuid",
                    "readOnly": true,
                    "type": [
                        "boolean",
                        "null"
                    ]
                },
                "to": {
                    "description": "survivor recipient of the trade, will be warned of pending trade through pending_trade HTTP header on every logged request, until it is marked as :accepted and :reviewed",
                    "format": "uuid",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "to_items": {
                    "description": "items added to trade with :from_items :owner, represented by 'items' array of JSON Item objects. It's owner will be warned of pending trade through pending_trade HTTP header on every logged request, until it is marked as :accepted and :reviewed",
                    "format": "uuid",
                    "readOnly": true,
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "updated_at": {
                    "description": "when trade was updated",
                    "type": [
                        "string"
                    ]
                }
            },
            "description": "Represents the transaction of items between survivors, while a survivor has a trade that hasn't been marked as :accepted and :reviewed it will receive all logged on requests marked with a 'pending_trade' HTTP header, which contains the trade's information as JSON",
            "links": [
                {
                    "description": "Create a new trade, at this point, only the attributes :to and :from_items must to be passed. After it's creation both users will receive all responses marked with pending_trade HHTP header, containing the data for this trade, until marked as :accepted and :reviewed.",
                    "href": "/trades",
                    "method": "POST",
                    "rel": "create",
                    "schema": {
                        "properties": {
                            "from_items": {
                                "$ref": "#/definitions/trade/definitions/from_items"
                            },
                            "to": {
                                "$ref": "#/definitions/trade/definitions/to"
                            }
                        },
                        "type": [
                            "object",
                            "null"
                        ]
                    },
                    "title": "Create"
                },
                {
                    "description": "Info for existing trade.",
                    "href": "/trades/{(%23%2Fdefinitions%2Ftrade%2Fdefinitions%2Fidentity)}",
                    "method": "GET",
                    "rel": "self",
                    "title": "Info"
                },
                {
                    "description": "List existing trades.",
                    "href": "/trades",
                    "method": "GET",
                    "rel": "instances",
                    "title": "List"
                },
                {
                    "description": "Delete an existing trade, only possible if logged survivor is one the :to or :from_items survivors and if trade isn't accepted and reviewed.",
                    "href": "/trades/{(%23%2Fdefinitions%2Ftrade%2Fdefinitions%2Fidentity)}",
                    "method": "DELETE",
                    "rel": "destroy",
                    "title": "Delete"
                },
                {
                    "description": "Update an existing trade, at this point there are 2 options for trade update 1 - The :to survivor is replying with :accepted and :to_items 2 - The survivor that owns :from_survivor is replying with :reviewed, so that the trade can be completed",
                    "href": "/trades/{(%23%2Fdefinitions%2Ftrade%2Fdefinitions%2Fidentity)}",
                    "method": "PATCH",
                    "rel": "update",
                    "schema": {
                        "properties": {
                            "accepted": {
                                "$ref": "#/definitions/trade/definitions/accepted"
                            },
                            "from_items": {
                                "$ref": "#/definitions/trade/definitions/from_items"
                            },
                            "reviewed": {
                                "$ref": "#/definitions/trade/definitions/reviewed"
                            },
                            "to": {
                                "$ref": "#/definitions/trade/definitions/to"
                            },
                            "to_items": {
                                "$ref": "#/definitions/trade/definitions/to_items"
                            }
                        },
                        "type": [
                            "object",
                            "null"
                        ]
                    },
                    "title": "Update"
                }
            ],
            "properties": {
                "accepted": {
                    "$ref": "#/definitions/trade/definitions/accepted"
                },
                "created_at": {
                    "$ref": "#/definitions/trade/definitions/created_at"
                },
                "from_items": {
                    "$ref": "#/definitions/trade/definitions/from_items"
                },
                "id": {
                    "$ref": "#/definitions/trade/definitions/id"
                },
                "reviewed": {
                    "$ref": "#/definitions/trade/definitions/reviewed"
                },
                "to": {
                    "$ref": "#/definitions/trade/definitions/to"
                },
                "to_items": {
                    "$ref": "#/definitions/trade/definitions/to_items"
                },
                "updated_at": {
                    "$ref": "#/definitions/trade/definitions/updated_at"
                }
            },
            "stability": "prototype",
            "strictProperties": true,
            "title": "Trade",
            "type": [
                "object"
            ]
        }
    },
    "description": "Social-zombie is a system to share resources between non-infected humans via API.",
    "links": [
        {
            "href": "https://github.com/ErvlahouS/social-zombie",
            "rel": "self"
        }
    ],
    "properties": {
        "infection": {
            "$ref": "#/definitions/infection"
        },
        "item": {
            "$ref": "#/definitions/item"
        },
        "survivor": {
            "$ref": "#/definitions/survivor"
        },
        "trade": {
            "$ref": "#/definitions/trade"
        }
    },
    "title": "Social-Zombie",
    "type": [
        "object"
    ]
}