{
    "swagger": "2.0",
    "host": "localhost:3000",
    "basePath": "/v1",
    "schemes": [
        "http"
    ],
    "info": {
        "title": "Test API Documentation",
        "version": "7.1.0",
        "description": "This is a sample example of API documentation.",
        "termsOfService": "https://github.com/glennjones/hapi-swagger/",
        "contact": {
            "email": "glennjonesnet@gmail.com"
        },
        "license": {
            "name": "MIT",
            "url": "https://raw.githubusercontent.com/glennjones/hapi-swagger/master/license.txt"
        }
    },
    "tags": [
        {
            "name": "sum",
            "description": "working with maths",
            "externalDocs": {
                "description": "Find out more",
                "url": "http://example.org"
            }
        },
        {
            "name": "store",
            "description": "storing data",
            "externalDocs": {
                "description": "Find out more",
                "url": "http://example.org"
            }
        },
        {
            "name": "properties",
            "description": "test the use of extended hapi/joi properties",
            "externalDocs": {
                "description": "Find out more",
                "url": "http://example.org"
            }
        }
    ],
    "securityDefinitions": {
        "Bearer": {
            "type": "apiKey",
            "name": "Authorization",
            "in": "header",
            "x-keyPrefix": "Bearer "
        }
    },
    "security": [
        {
            "Bearer": []
        }
    ],
    "paths": {
        "/bar/arrays": {
            "post": {
                "operationId": "postBarArrays",
                "parameters": [
                    {
                        "name": "FooArrParent",
                        "in": "body",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/definitions/FooArrObj"
                                },
                                "name": "FooArr"
                            }
                        }
                    }
                ],
                "tags": [
                    "bar/arrays"
                ],
                "responses": {
                    "200": {
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/definitions/FooArrObj"
                                },
                                "name": "FooArr"
                            },
                            "name": "FooArrParent"
                        },
                        "description": "Successful"
                    }
                }
            }
        },
        "/bar/objects": {
            "post": {
                "operationId": "postBarObjects",
                "parameters": [
                    {
                        "in": "body",
                        "name": "body",
                        "schema": {
                            "type": "object",
                            "$ref": "#/definitions/FooObjParent"
                        }
                    }
                ],
                "tags": [
                    "bar/objects"
                ],
                "responses": {
                    "200": {
                        "schema": {
                            "$ref": "#/definitions/FooObjParent"
                        },
                        "description": "Successful"
                    }
                }
            }
        },
        "/store/": {
            "post": {
                "operationId": "postStore",
                "parameters": [
                    {
                        "x-alternatives": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "string"
                            }
                        ],
                        "in": "body",
                        "name": "body",
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "tags": [
                    "store"
                ],
                "responses": {
                    "default": {
                        "schema": {
                            "type": "string"
                        },
                        "description": "Successful"
                    }
                }
            }
        },
        "/store/payload1/{b}": {
            "post": {
                "operationId": "postV1StorePayload1B",
                "parameters": [
                    {
                        "type": "string",
                        "name": "x",
                        "in": "header"
                    },
                    {
                        "type": "number",
                        "description": "the first number",
                        "name": "b",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "name": "a",
                        "in": "query"
                    },
                    {
                        "description": "test text",
                        "required": true,
                        "name": "DatapointList",
                        "in": "body",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/Datapoint"
                            }
                        }
                    }
                ],
                "tags": [
                    "store"
                ],
                "responses": {
                    "default": {
                        "schema": {
                            "type": "string"
                        },
                        "description": "Successful"
                    }
                }
            }
        },
        "/store/payload2/": {
            "post": {
                "operationId": "postV1StorePayload2",
                "parameters": [
                    {
                        "type": "string",
                        "format": "date",
                        "name": "date",
                        "in": "formData",
                        "required": true
                    },
                    {
                        "type": "number",
                        "name": "value",
                        "in": "formData",
                        "required": true
                    }
                ],
                "consumes": [
                    "application/x-www-form-urlencoded"
                ],
                "tags": [
                    "store"
                ],
                "responses": {
                    "default": {
                        "schema": {
                            "type": "string"
                        },
                        "description": "Successful"
                    }
                }
            }
        },
        "/store/payload3/": {
            "post": {
                "operationId": "postV1StorePayload3",
                "parameters": [
                    {
                        "name": "TopTenList",
                        "in": "body",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/TopTen"
                            }
                        }
                    }
                ],
                "tags": [
                    "store"
                ],
                "responses": {
                    "default": {
                        "schema": {
                            "type": "string"
                        },
                        "description": "Successful"
                    }
                }
            }
        },
        "/store/payloadA/": {
            "post": {
                "operationId": "postV1StorePayloada",
                "parameters": [
                    {
                        "in": "body",
                        "name": "body",
                        "schema": {
                            "type": "object",
                            "$ref": "#/definitions/Sum"
                        }
                    }
                ],
                "tags": [
                    "store"
                ],
                "responses": {
                    "default": {
                        "schema": {
                            "type": "string"
                        },
                        "description": "Successful"
                    }
                }
            }
        }
    },
    "definitions": {
        "FooArrObj": {
            "type": "object",
            "properties": {
                "bar": {
                    "type": "string"
                }
            }
        },
        "FooObj": {
            "type": "object",
            "properties": {
                "foo": {
                    "type": "string",
                    "description": "some foo"
                }
            }
        },
        "FooObjParent": {
            "type": "object",
            "properties": {
                "FooObj": {
                    "$ref": "#/definitions/FooObj"
                }
            }
        },
        "Datapoint": {
            "type": "object",
            "properties": {
                "date": {
                    "type": "string",
                    "format": "date",
                    "example": "2016-08-26"
                },
                "value": {
                    "type": "number",
                    "example": "1024"
                }
            },
            "required": [
                "date",
                "value"
            ]
        },
        "TopTen": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "description": "user name"
                },
                "score": {
                    "type": "number",
                    "minimum": 0
                }
            },
            "required": [
                "name",
                "score"
            ]
        },
        "Sum": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string",
                    "example": "x78P9c"
                },
                "a": {
                    "type": "number",
                    "example": 5
                },
                "b": {
                    "type": "number",
                    "example": 5
                },
                "operator": {
                    "type": "string",
                    "description": "either +, -, /, or *",
                    "example": "+"
                },
                "equals": {
                    "type": "number",
                    "example": 10
                },
                "created": {
                    "type": "string",
                    "description": "ISO date string",
                    "example": "2015-12-01",
                    "x-format": {
                        "isoDate": true
                    }
                },
                "modified": {
                    "type": "string",
                    "description": "ISO date string",
                    "example": "2015-12-01",
                    "x-format": {
                        "isoDate": true
                    }
                }
            },
            "required": [
                "id",
                "a",
                "b",
                "operator",
                "equals",
                "created"
            ]
        }
    }
}