{
    "swagger": "2.0",
    "info": {
        "title": "DAWA_wines_api",
        "version": "1.0.0"
    },
    "basePath": "/",
    "x-policy": {
        "match": "any",
        "header": "acceptUndefined",
        "query": "definedOnly",
        "formData": "definedOnly",
        "body": "acceptUndefined"
    },
    "paths": {
        "/WS/REST/wines": {
            "get": {},
            "post": {
                "parameters": [
                    {
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/addwineRequest"
                        }
                    }
                ]
            }
        },
        "/WS/REST/wines/search/{name}": {
            "get": {
                "parameters": [
                    {
                        "name": "name",
                        "in": "path",
                        "required": true,
                        "type": "string",
                        "pattern": "^([a-zA-Z0-9 ])*$",
                        "minLength": 1
                    }
                ]
            }
        },
        "/WS/REST/wines/{id}": {
            "get": {
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "type": "string",
                        "pattern": "^[0-9]+$",
                        "minLength": 1,
                        "maxLength": 5
                    }
                ]
            },
            "put": {
                "parameters": [
                    {
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/updatewineRequest"
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "type": "string",
                        "pattern": "^[0-9]+$",
                        "minLength": 1,
                        "maxLength": 5
                    }
                ]
            },
            "delete": {
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "type": "integer"
                    }
                ]
            }
        }
    },
    "parameters": {},
    "definitions": {
        "addwineRequest": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string",
                    "pattern": "^$"
                },
                "name": {
                    "type": "string",
                    "pattern": ".+"
                },
                "year": {
                    "type": "string",
                    "pattern": "^[1-2][0-9][0-9][0-9]$"
                },
                "grapes": {
                    "type": "string",
                    "pattern": ".+"
                },
                "country": {
                    "type": "string",
                    "pattern": ".+"
                },
                "region": {
                    "type": "string",
                    "pattern": ".+"
                },
                "description": {
                    "type": "string",
                    "pattern": ".+"
                }
            },
            "required": [
                "name",
                "grapes",
                "country",
                "region",
                "year",
                "description"
            ],
            "additionalProperties": false,
            "maxProperties": 7
        },
        "updatewineRequest": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                },
                "name": {
                    "type": "string",
                    "pattern": ".+"
                },
                "year": {
                    "type": "string",
                    "pattern": "^[1-2][0-9][0-9][0-9]$"
                },
                "grapes": {
                    "type": "string",
                    "pattern": ".+"
                },
                "country": {
                    "type": "string",
                    "pattern": ".+"
                },
                "region": {
                    "type": "string",
                    "pattern": ".+"
                },
                "description": {
                    "type": "string",
                    "pattern": ".+"
                },
                "picture": {
                    "type": "string"
                }
            },
            "required": [
                "id",
                "name",
                "grapes",
                "country",
                "region",
                "year",
                "description"
            ],
            "additionalProperties": false,
            "maxProperties": 8
        }
    }
}