{ "swagger": "2.0", "info": { "description": "Api Documentation", "version": "1.0", "title": "Api Documentation", "termsOfService": "urn:tos", "contact": {}, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0" } }, "schemes": [ "http" ], "host": "localhost:50117", "basePath": "/", "tags": [ { "name": "cart-rest-controller", "description": "Cart Rest Controller" }, { "name": "contacts-rest-controller", "description": "Contacts Rest Controller" }, { "name": "customer-rest-controller", "description": "Customer Rest Controller" }, { "name": "orders-rest-controller", "description": "Orders Rest Controller" }, { "name": "products-rest-controller", "description": "Products Rest Controller" } ], "paths": { "/customer": { "get": { "tags": [ "customer-rest-controller" ], "summary": "getCustomer", "operationId": "getCustomerUsingGET", "produces": [ "*/*" ], "parameters": [ { "name": "name", "in": "query", "required": false, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/UserDTORes" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } }, "/customer/cart": { "get": { "tags": [ "cart-rest-controller" ], "summary": "getCart", "operationId": "getCartUsingGET", "produces": [ "*/*" ], "parameters": [ { "name": "name", "in": "query", "required": false, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/CartDTO" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } }, "put": { "tags": [ "cart-rest-controller" ], "summary": "addItem", "operationId": "addItemUsingPUT", "consumes": [ "application/json" ], "produces": [ "*/*" ], "parameters": [ { "in": "body", "name": "item", "description": "item", "required": true, "schema": { "$ref": "#/definitions/CartItemDTOReq" } }, { "name": "name", "in": "query", "required": false, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/CartDTO" } }, "201": { "description": "Created" }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } }, "delete": { "tags": [ "cart-rest-controller" ], "summary": "clearCart", "operationId": "clearCartUsingDELETE", "produces": [ "*/*" ], "parameters": [ { "name": "name", "in": "query", "required": false, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/CartDTO" } }, "204": { "description": "No Content" }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" } } } }, "/customer/cart/delivery": { "put": { "tags": [ "cart-rest-controller" ], "summary": "setDelivery", "operationId": "setDeliveryUsingPUT", "consumes": [ "application/json" ], "produces": [ "*/*" ], "parameters": [ { "name": "included", "in": "query", "description": "included", "required": true, "type": "boolean", "x-example": true }, { "name": "name", "in": "query", "required": false, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/CartDTO" } }, "201": { "description": "Created" }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } }, "/customer/cart/pay": { "post": { "tags": [ "cart-rest-controller" ], "summary": "payByCard", "operationId": "payByCardUsingPOST", "consumes": [ "application/json" ], "produces": [ "*/*" ], "parameters": [ { "in": "body", "name": "card", "description": "card", "required": true, "schema": { "$ref": "#/definitions/CreditCardDTO" } }, { "name": "name", "in": "query", "required": false, "type": "string" } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/OrderDTO" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } }, "/customer/contacts": { "get": { "tags": [ "contacts-rest-controller" ], "summary": "getContacts", "operationId": "getContactsUsingGET", "produces": [ "*/*" ], "parameters": [ { "name": "name", "in": "query", "required": false, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ContactsDTORes" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } }, "put": { "tags": [ "contacts-rest-controller" ], "summary": "updateContacts", "operationId": "updateContactsUsingPUT", "consumes": [ "application/json" ], "produces": [ "*/*" ], "parameters": [ { "in": "body", "name": "contactsDto", "description": "contactsDto", "required": true, "schema": { "$ref": "#/definitions/ContactsDTOReq" } }, { "name": "name", "in": "query", "required": false, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ContactsDTORes" } }, "201": { "description": "Created" }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } }, "/customer/orders": { "get": { "tags": [ "orders-rest-controller" ], "summary": "getOrders", "operationId": "getOrdersUsingGET", "produces": [ "*/*" ], "parameters": [ { "name": "name", "in": "query", "required": false, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/OrderDTO" } } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } }, "/customer/orders/{orderId}": { "get": { "tags": [ "orders-rest-controller" ], "summary": "getOrder", "operationId": "getOrderUsingGET", "produces": [ "*/*" ], "parameters": [ { "name": "name", "in": "query", "required": false, "type": "string" }, { "name": "orderId", "in": "path", "description": "orderId", "required": true, "type": "integer", "format": "int64", "x-example": 123 } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/OrderDTO" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } }, "/products": { "get": { "tags": [ "products-rest-controller" ], "summary": "getProducts", "operationId": "getProductsUsingGET", "produces": [ "*/*" ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/ProductDTO" } } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } }, "/products/{productId}": { "get": { "tags": [ "products-rest-controller" ], "summary": "getProduct", "operationId": "getProductUsingGET", "produces": [ "*/*" ], "parameters": [ { "name": "productId", "in": "path", "description": "productId", "required": true, "type": "integer", "format": "int64", "x-example": 123 } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ProductDTO" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } }, "/register": { "post": { "tags": [ "customer-rest-controller" ], "summary": "createCustomer", "operationId": "createCustomerUsingPOST", "consumes": [ "application/json" ], "produces": [ "*/*" ], "parameters": [ { "in": "body", "name": "user", "description": "user", "required": true, "schema": { "$ref": "#/definitions/UserDTOReq" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/UserDTORes" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" } } } } }, "definitions": { "CartDTO": { "type": "object", "properties": { "_links": { "$ref": "#/definitions/Links" }, "cartItems": { "type": "array", "items": { "$ref": "#/definitions/CartItemDTORes" } }, "deliveryCost": { "type": "integer", "format": "int32" }, "deliveryIncluded": { "type": "boolean" }, "empty": { "type": "boolean" }, "productsCost": { "type": "number", "format": "double" }, "totalCost": { "type": "number", "format": "double" }, "totalItems": { "type": "integer", "format": "int32" }, "user": { "type": "string" } }, "title": "CartDTO" }, "CartItemDTOReq": { "type": "object", "properties": { "_links": { "type": "array", "items": { "$ref": "#/definitions/Link" } }, "productId": { "type": "integer", "format": "int64" }, "quantity": { "type": "integer", "format": "int32" } }, "title": "CartItemDTOReq" }, "CartItemDTORes": { "type": "object", "properties": { "_links": { "$ref": "#/definitions/Links" }, "productId": { "type": "integer", "format": "int64" }, "quantity": { "type": "integer", "format": "int32" } }, "title": "CartItemDTORes" }, "ContactsDTOReq": { "type": "object", "properties": { "_links": { "type": "array", "items": { "$ref": "#/definitions/Link" } }, "address": { "type": "string", "minLength": 0, "maxLength": 100, "pattern": "^[^#$%^*()']*$" }, "phone": { "type": "string", "minLength": 0, "maxLength": 20, "pattern": "^\\+[1-9][0-9]?[\\s]*\\(?\\d{3}\\)?[-\\s]?\\d{3}[-\\s]?\\d{2}[-\\s]?\\d{2}$" } }, "title": "ContactsDTOReq" }, "ContactsDTORes": { "type": "object", "properties": { "_links": { "$ref": "#/definitions/Links" }, "address": { "type": "string", "minLength": 0, "maxLength": 100, "pattern": "^[^#$%^*()']*$" }, "phone": { "type": "string", "minLength": 0, "maxLength": 20, "pattern": "^\\+[1-9][0-9]?[\\s]*\\(?\\d{3}\\)?[-\\s]?\\d{3}[-\\s]?\\d{2}[-\\s]?\\d{2}$" } }, "title": "ContactsDTORes" }, "CreditCardDTO": { "type": "object", "properties": { "ccNumber": { "type": "string", "pattern": "\\b(?:\\d[ -]*?){13,16}\\b" } }, "title": "CreditCardDTO" }, "Link": { "type": "object", "properties": { "deprecation": { "type": "string" }, "href": { "type": "string" }, "hreflang": { "type": "string" }, "media": { "type": "string" }, "name": { "type": "string" }, "profile": { "type": "string" }, "rel": { "$ref": "#/definitions/LinkRelation" }, "title": { "type": "string" }, "type": { "type": "string" } }, "title": "Link" }, "LinkRelation": { "type": "object", "title": "LinkRelation" }, "Links": { "type": "object", "properties": { "empty": { "type": "boolean" } }, "title": "Links" }, "OrderDTO": { "type": "object", "properties": { "_links": { "$ref": "#/definitions/Links" }, "billNumber": { "type": "integer", "format": "int32" }, "dateCreated": { "type": "string", "format": "date-time" }, "deliveryCost": { "type": "integer", "format": "int32" }, "deliveryIncluded": { "type": "boolean" }, "executed": { "type": "boolean" }, "id": { "type": "integer", "format": "int64" }, "payed": { "type": "boolean" }, "productsCost": { "type": "number", "format": "double" }, "totalCost": { "type": "number", "format": "double" }, "userAccount": { "type": "string" } }, "title": "OrderDTO" }, "ProductDTO": { "type": "object", "required": [ "alcohol", "price", "volume" ], "properties": { "_links": { "$ref": "#/definitions/Links" }, "age": { "type": "integer", "format": "int32", "maximum": 2000, "exclusiveMaximum": false }, "alcohol": { "type": "number", "format": "float", "minimum": 1, "maximum": 96, "exclusiveMinimum": false, "exclusiveMaximum": false }, "available": { "type": "boolean" }, "description": { "type": "string" }, "distillery": { "type": "string" }, "name": { "type": "string", "pattern": "^[^#$%^&*()']*$" }, "price": { "type": "number", "format": "double" }, "productId": { "type": "integer", "format": "int64" }, "volume": { "type": "integer", "format": "int32" } }, "title": "ProductDTO" }, "UserDTOReq": { "type": "object", "properties": { "_links": { "type": "array", "items": { "$ref": "#/definitions/Link" } }, "address": { "type": "string", "minLength": 0, "maxLength": 100, "pattern": "^[^#$%^*()']*$" }, "email": { "type": "string", "minLength": 0, "maxLength": 50, "pattern": "^[\\w-]+(\\.[\\w-]+)*@([\\w-]+\\.)+[a-zA-Z]+$" }, "name": { "type": "string", "minLength": 0, "maxLength": 50, "pattern": "^[\\pL '-]+$" }, "password": { "type": "string", "minLength": 6, "maxLength": 50, "pattern": "^[a-zA-Z0-9]+$" }, "phone": { "type": "string", "minLength": 0, "maxLength": 20, "pattern": "^\\+[1-9][0-9]?[\\s]*\\(?\\d{3}\\)?[-\\s]?\\d{3}[-\\s]?\\d{2}[-\\s]?\\d{2}$" } }, "title": "UserDTOReq" }, "UserDTORes": { "type": "object", "properties": { "_links": { "$ref": "#/definitions/Links" }, "address": { "type": "string", "minLength": 0, "maxLength": 100, "pattern": "^[^#$%^*()']*$" }, "email": { "type": "string", "minLength": 0, "maxLength": 50, "pattern": "^[\\w-]+(\\.[\\w-]+)*@([\\w-]+\\.)+[a-zA-Z]+$" }, "name": { "type": "string", "minLength": 0, "maxLength": 50, "pattern": "^[\\pL '-]+$" }, "password": { "type": "string", "minLength": 6, "maxLength": 50, "pattern": "^[a-zA-Z0-9]+$" }, "phone": { "type": "string", "minLength": 0, "maxLength": 20, "pattern": "^\\+[1-9][0-9]?[\\s]*\\(?\\d{3}\\)?[-\\s]?\\d{3}[-\\s]?\\d{2}[-\\s]?\\d{2}$" } }, "title": "UserDTORes" } } }