{
    "swagger" : "2.0",
    "info" : {
        "description" : "Sample services",
        "version" : "0.0.1-SNAPSHOT",
        "title" : "Sample app",
        "termsOfService" : "http://www.company.com",
        "contact" : {
            "name" : "ApiSupport",
            "url" : "http://www.company.com",
            "email" : "apisupport@company.com"
        },
        "license" : {
            "name" : "Apache 2.0",
            "url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
        }
    },
    "host" : "company.com",
    "basePath" : "/",
    "schemes" : [ "http", "https" ],
    "paths" : {
        "/office/{officeCode}/subOffice/{subOfficeCode}" : {
            "get" : {
                "summary" : "Return the workers",
                "description" : "Return the workers",
                "operationId" : "getOffice",
                "produces" : [ "application/json" ],
                "parameters" : [ {
                    "name" : "officeCode",
                    "in" : "path",
                    "required" : true,
                    "type" : "integer",
                    "format" : "int64"
                }, {
                    "name" : "subOfficeCode",
                    "in" : "path",
                    "required" : true,
                    "type" : "integer",
                    "format" : "int64"
                }, {
                    "name" : "date",
                    "in" : "query",
                    "required" : false,
                    "type" : "string"
                }, {
                    "name" : "APP_NAME",
                    "in" : "header",
                    "required" : true,
                    "type" : "string"
                } ],
                "responses" : {
                    "200" : {
                        "description" : "Data retrieved correctly",
                        "schema" : {
                            "$ref" : "#/definitions/Office"
                        }
                    },
                    "400" : {
                        "description" : "Data sent are not acceptable"
                    },
                    "500" : {
                        "description" : "System Error"
                    }
                }
            }
        }
    },
    "definitions" : {
        "Worker" : {
            "type" : "object",
            "properties" : {
                "id" : {
                    "type" : "integer",
                    "format" : "int64"
                },
                "code" : {
                    "type" : "integer",
                    "format" : "int64"
                },
                "officeCode" : {
                    "type" : "string"
                },
                "personId" : {
                    "type" : "integer",
                    "format" : "int64"
                },
                "description" : {
                    "type" : "string"
                },
                "surname" : {
                    "type" : "string"
                },
                "name" : {
                    "type" : "string"
                }
            }
        },
         "Message" : {
            "type" : "object",
            "properties" : {
                "code" : {
                    "type" : "string"
                },
                "text" : {
                    "type" : "string"
                },
                "messageType" : {
                    "type" : "string",
                    "enum" : [ "info", "warning", "error" ]
                }
            }
        },
        "Office" : {
            "type" : "object",
            "properties" : {
                "body" : {
                    "type" : "array",
                    "items" : {
                        "$ref" : "#/definitions/Worker"
                    }
                },
                "messages" : {
                    "type" : "array",
                    "items" : {
                        "$ref" : "#/definitions/Message"
                    }
                },
                "messagesList" : {
                    "type" : "array",
                    "items" : {
                        "$ref" : "#/definitions/Message"
                    }
                }
            }
        },

    }
}
