{
  "openapi": "3.0.1",
  "info": {
    "title": "DAWA_wines_api",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "paths": {
    "/WS/REST/wines": {
      "get": {},
      "post": {
        "requestBody": {
          "content": {
            "*/*": {
              "schema": {
                "$ref": "#/components/schemas/addwineRequest"
              }
            }
          },
          "required": true
        },
        "x-codegen-request-body-name": "body"
      }
    },
    "/WS/REST/wines/search/{name}": {
      "get": {
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "minLength": 1,
              "pattern": "^([a-zA-Z0-9 ])*$",
              "type": "string"
            }
          }
        ]
      }
    },
    "/WS/REST/wines/{id}": {
      "get": {
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "maxLength": 5,
              "minLength": 1,
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ]
      },
      "put": {
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "maxLength": 5,
              "minLength": 1,
              "pattern": "^[0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "*/*": {
              "schema": {
                "$ref": "#/components/schemas/updatewineRequest"
              }
            }
          },
          "required": true
        },
        "x-codegen-request-body-name": "body"
      },
      "delete": {
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "addwineRequest": {
        "required": [
          "country",
          "description",
          "grapes",
          "name",
          "region",
          "year"
        ],
        "type": "object",
        "properties": {
          "id": {
            "pattern": "^$",
            "type": "string"
          },
          "name": {
            "pattern": ".+",
            "type": "string"
          },
          "year": {
            "pattern": "^[1-2][0-9][0-9][0-9]$",
            "type": "string"
          },
          "grapes": {
            "pattern": ".+",
            "type": "string"
          },
          "country": {
            "pattern": ".+",
            "type": "string"
          },
          "region": {
            "pattern": ".+",
            "type": "string"
          },
          "description": {
            "pattern": ".+",
            "type": "string"
          }
        }
      },
      "updatewineRequest": {
        "required": [
          "country",
          "description",
          "grapes",
          "id",
          "name",
          "region",
          "year"
        ],
        "type": "object",
        "properties": {
          "id": {
            "pattern": "^[0-9]+$",
            "type": "string"
          },
          "name": {
            "pattern": ".+",
            "type": "string"
          },
          "year": {
            "pattern": "^[1-2][0-9][0-9][0-9]$",
            "type": "string"
          },
          "grapes": {
            "pattern": ".+",
            "type": "string"
          },
          "country": {
            "pattern": ".+",
            "type": "string"
          },
          "region": {
            "pattern": ".+",
            "type": "string"
          },
          "description": {
            "pattern": ".+",
            "type": "string"
          },
          "picture": {
            "type": "string"
          }
        }
      }
    }
  },
  "x-policy": {
    "match": "any",
    "header": "acceptUndefined",
    "query": "definedOnly",
    "formData": "definedOnly",
    "body": "acceptUndefined"
  }
}