{ "openapi": "3.0.0", "info": { "title": "API Pizzaria-nodejs", "description": "API para Pizzaria, completa contendo o CRUD de diversos assuntos", "contact": { "name": "Rodrigo", "email": "sbezerra.rodrigo@gmail.com" }, "version": "1.0.0" }, "servers": [ { "url": "http://localhost:3000/", "description": "API de teste LOCAL" } ], "paths": { "/usuario/findAll": { "get": { "security": [ { "bearerAuth": [] } ], "summary": "Lista todos os usuarios da API", "description": "Rota responsavel por listar todos os usuarios da API", "tags": ["Usuario"], "parameters": [ { "in": "query", "schema": { "type": "integer" }, "name": "limit" }, { "in": "query", "schema": { "type": "integer" }, "name": "offset" } ], "responses": { "200": { "description": "Ok, tarefa realizada com sucesso", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "$ref": "#/components/schemas/Usuario" } } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhum usuario encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/usuario/find/{id}": { "get": { "security": [ { "bearerAuth": [] } ], "summary": "Lista o usuario que corresponde com o Id informado", "description": "Rota responsavel por localizar um usuario da API atraves do ID informado", "tags": ["Usuario"], "parameters": [ { "in": "path", "required": true, "schema": { "type": "string" }, "name": "id" } ], "responses": { "200": { "description": "Retorna um usuario que foi encontrado atraves do id informado", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/Usuario" } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhum usuario encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/usuario/create": { "post": { "summary": "Criar um usuario novo", "description": "Rota responsavel por criar um novo usuario atraves das informaçoes passadas no endpoint", "tags": ["Usuario"], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/Usuario" } } }, "required": true }, "responses": { "201": { "description": "Retorna o objeto criado no banco", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/Usuario" } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/usuario/update/{id}": { "put": { "security": [ { "bearerAuth": [] } ], "summary": "Lista o usuario que corresponde com o Id informado", "description": "Rota responsavel por localizar um usuario da API atraves do ID informado", "tags": ["Usuario"], "parameters": [ { "in": "path", "required": true, "schema": { "type": "string" }, "name": "id" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/Usuario" } } }, "required": true }, "responses": { "200": { "description": "Retorna o objeto atualizado no banco", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/Usuario" } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhum usuario encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/usuario/remove/{id}": { "delete": { "security": [ { "bearerAuth": [] } ], "summary": "Lista o usuario que corresponde com o Id informado", "description": "Rota responsavel por localizar um usuario da API atraves do ID informado", "tags": ["Usuario"], "parameters": [ { "in": "path", "required": true, "schema": { "type": "string" }, "name": "id" } ], "responses": { "200": { "description": "Retorna o objeto deletado do banco", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/Usuario" } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhum usuario encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/usuario/addAddress/{id}": { "post": { "security": [ { "bearerAuth": [] } ], "summary": "Adiciona o endereco no usuario", "description": "Rota responsavel por Adicionar enderecos no usuario informado", "tags": ["Usuario"], "parameters": [ { "in": "path", "required": true, "schema": { "type": "string" }, "name": "id" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/UserAddress" } } }, "required": true }, "responses": { "201": { "description": "Retorna um usuario com seu novo endereco", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/Usuario" } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhum usuario encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/usuario/removeAddress/": { "delete": { "security": [ { "bearerAuth": [] } ], "summary": "Remove o endereco do usuario", "description": "Rota responsavel por remover enderecos no usuario informado", "tags": ["Usuario"], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "addressId": { "type": "string" } } } } }, "required": true }, "responses": { "200": { "description": "Retorna um usuario com seu endereco removido", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/Usuario" } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhum usuario encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/usuario/addFavProduct/{id}": { "post": { "security": [ { "bearerAuth": [] } ], "summary": "Adiciona produtos favoritos no usuario", "description": "Rota responsavel por Adicionar produtos favoritos no usuario informado", "tags": ["Usuario"], "parameters": [ { "in": "path", "required": true, "schema": { "type": "string" }, "name": "id" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/ProductFav" } } }, "required": true }, "responses": { "201": { "description": "Retorna um usuario com seu novo produto favorito", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/Usuario" } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhum usuario encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/usuario/removeFavProduct/{id}": { "delete": { "security": [ { "bearerAuth": [] } ], "summary": "Remove o produto favorito do usuario", "description": "Rota responsavel por remover produtos favoritos no usuario informado", "tags": ["Usuario"], "parameters": [ { "in": "path", "required": true, "schema": { "type": "string" }, "name": "id" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "_id": { "type": "string" } } } } }, "required": true }, "responses": { "200": { "description": "Retorna um usuario com seu produto favorito removido", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/Usuario" } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhum usuario encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/pizza/findAll": { "get": { "security": [ { "bearerAuth": [] } ], "summary": "Lista todas as pizzas da API", "description": "Rota responsavel por listar todas as pizzas da API", "tags": ["Pizza"], "parameters": [ { "in": "query", "schema": { "type": "integer" }, "name": "limit" }, { "in": "query", "schema": { "type": "integer" }, "name": "offset" } ], "responses": { "200": { "description": "Ok, tarefa realizada com sucesso", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "$ref": "#/components/schemas/Pizza" } } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhuma pizza encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/pizza/find/{id}": { "get": { "security": [ { "bearerAuth": [] } ], "summary": "Lista a pizza que corresponde com o Id informado", "description": "Rota responsavel por localizar uma pizza da API atraves do ID informado", "tags": ["Pizza"], "parameters": [ { "in": "path", "required": true, "schema": { "type": "string" }, "name": "id" } ], "responses": { "200": { "description": "Retorna uma pizza que foi encontrado atraves do id informado", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/Pizza" } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhuma pizza encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/pizza/create": { "post": { "security": [ { "bearerAuth": [] } ], "summary": "Criar uma nova pizza", "description": "Rota responsavel por criar nova pizza atraves das informaçoes passadas no endpoint", "tags": ["Pizza"], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/Pizza" } } }, "required": true }, "responses": { "201": { "description": "Retorna o objeto criado no banco", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/Pizza" } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/pizza/update/{id}": { "put": { "security": [ { "bearerAuth": [] } ], "summary": "Atualiza a pizza que corresponde com o Id informado", "description": "Rota responsavel por localizar e atualizar uma pizza da API atraves do ID informado", "tags": ["Pizza"], "parameters": [ { "in": "path", "required": true, "schema": { "type": "string" }, "name": "id" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/Pizza" } } }, "required": true }, "responses": { "200": { "description": "Retorna o objeto atualizado no banco", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/Pizza" } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhum usuario encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/pizza/deletePizza/{id}": { "delete": { "security": [ { "bearerAuth": [] } ], "summary": "Remove a pizza que corresponde com o Id informado", "description": "Rota responsavel por localizar e remover uma pizza da API atraves do ID informado", "tags": ["Pizza"], "parameters": [ { "in": "path", "required": true, "schema": { "type": "string" }, "name": "id" } ], "responses": { "200": { "description": "Retorna o objeto deletado do banco", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/Pizza" } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhum usuario encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/pizza/addIngredientePizza/{id}": { "post": { "security": [ { "bearerAuth": [] } ], "summary": "Relaciona ingrediente com a pizza que corresponde com o Id informado", "description": "Rota responsavel relacionar ingrediente com uma pizza da API atraves do ID informado", "tags": ["Pizza"], "parameters": [ { "in": "path", "required": true, "schema": { "type": "string" }, "name": "id" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/IngredientePizza" } } }, "required": true }, "responses": { "200": { "description": "Retorna a pizza com o ingrediente inserido", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/Pizza" } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhum registro encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/pizza/deleteIngredientePizza/{id}": { "delete": { "security": [ { "bearerAuth": [] } ], "summary": "Remove ingrediente da pizza que corresponde com o Id informado", "description": "Rota responsavel remover ingrediente de uma pizza da API atraves do ID informado", "tags": ["Pizza"], "parameters": [ { "in": "path", "required": true, "schema": { "type": "string" }, "name": "id" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/IngredientePizza" } } }, "required": true }, "responses": { "200": { "description": "Retorna a pizza sem o ingrediente", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/Pizza" } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhum registro encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/ingrediente/create": { "post": { "security": [ { "bearerAuth": [] } ], "summary": "Criar um ingrediente", "description": "Rota responsavel por criar novo ingrediente atraves das informaçoes passadas no endpoint", "tags": ["Ingrediente"], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/ingredienteSchema" } } }, "required": true }, "responses": { "201": { "description": "Retorna o objeto criado no banco", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/ingredienteSchema" } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/ingrediente/findAll": { "get": { "security": [ { "bearerAuth": [] } ], "summary": "Lista todos os ingredientes da API", "description": "Rota responsavel por listar todos os ingredientes da API", "tags": ["Ingrediente"], "parameters": [ { "in": "query", "schema": { "type": "integer" }, "name": "limit" }, { "in": "query", "schema": { "type": "integer" }, "name": "offset" } ], "responses": { "200": { "description": "Ok, tarefa realizada com sucesso", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "$ref": "#/components/schemas/ingredienteSchema" } } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhum ingrediente encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/ingrediente/find/{id}": { "get": { "security": [ { "bearerAuth": [] } ], "summary": "Lista o ingrediente que corresponde com o Id informado", "description": "Rota responsavel por localizar um ingrediente da API atraves do ID informado", "tags": ["Ingrediente"], "parameters": [ { "in": "path", "required": true, "schema": { "type": "string" }, "name": "id" } ], "responses": { "200": { "description": "Retorna um ingrediente que foi encontrado atraves do id informado", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/ingredienteSchema" } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhum ingrediente encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/ingrediente/update/{id}": { "put": { "security": [ { "bearerAuth": [] } ], "summary": "Atualiza o ingrediente que corresponde com o Id informado", "description": "Rota responsavel por localizar e atualizar um ingrediente da API atraves do ID informado", "tags": ["Ingrediente"], "parameters": [ { "in": "path", "required": true, "schema": { "type": "string" }, "name": "id" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/ingredienteSchema" } } }, "required": true }, "responses": { "200": { "description": "Retorna o objeto atualizado no banco", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/ingredienteSchema" } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhum ingrediente encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/ingrediente/delete/{id}": { "delete": { "security": [ { "bearerAuth": [] } ], "summary": "Remove o ingrediente que corresponde com o Id informado", "description": "Rota responsavel por localizar e remover um ingrediente da API atraves do ID informado", "tags": ["Ingrediente"], "parameters": [ { "in": "path", "required": true, "schema": { "type": "string" }, "name": "id" } ], "responses": { "200": { "description": "Retorna o objeto deletado do banco", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/ingredienteSchema" } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhum ingrediente encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/bebida/create": { "post": { "security": [ { "bearerAuth": [] } ], "summary": "Criar uma bebida", "description": "Rota responsavel por criar um nova bebida atraves das informaçoes passadas no endpoint", "tags": ["Bebida"], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/ingredienteSchema" } } }, "required": true }, "responses": { "201": { "description": "Retorna o objeto criado no banco", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/bebidaSchema" } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/bebida/findAll": { "get": { "security": [ { "bearerAuth": [] } ], "summary": "Lista todos bebidas da API", "description": "Rota responsavel por listar todos as bebidas da API", "tags": ["Bebida"], "parameters": [ { "in": "query", "schema": { "type": "integer" }, "name": "limit" }, { "in": "query", "schema": { "type": "integer" }, "name": "offset" } ], "responses": { "200": { "description": "Ok, tarefa realizada com sucesso", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "$ref": "#/components/schemas/ingredienteSchema" } } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhuma bebida encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/bebida/find/{id}": { "get": { "security": [ { "bearerAuth": [] } ], "summary": "Lista a bebida que corresponde com o Id informado", "description": "Rota responsavel por localizar uma bebida da API atraves do ID informado", "tags": ["Bebida"], "parameters": [ { "in": "path", "required": true, "schema": { "type": "string" }, "name": "id" } ], "responses": { "200": { "description": "Retorna um ingrediente que foi encontrado atraves do id informado", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/ingredienteSchema" } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhum ingrediente encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/bebida/update/{id}": { "put": { "security": [ { "bearerAuth": [] } ], "summary": "Atualiza a bebida que corresponde com o Id informado", "description": "Rota responsavel por localizar e atualizar uma bebida da API atraves do ID informado", "tags": ["Bebida"], "parameters": [ { "in": "path", "required": true, "schema": { "type": "string" }, "name": "id" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/bebidaSchema" } } }, "required": true }, "responses": { "200": { "description": "Retorna o objeto atualizado no banco", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/bebidaSchema" } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhuma bebida encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } }, "/bebida/delete/{id}": { "delete": { "security": [ { "bearerAuth": [] } ], "summary": "Remove bebida que corresponde com o Id informado", "description": "Rota responsavel por localizar e remover bebida da API atraves do ID informado", "tags": ["Bebida"], "parameters": [ { "in": "path", "required": true, "schema": { "type": "string" }, "name": "id" } ], "responses": { "200": { "description": "Retorna o objeto deletado do banco", "content": { "application/json": { "schema": { "type": "object", "$ref": "#/components/schemas/ingredienteSchema" } } } }, "401": { "description": "Unauthorized, Erro de autenticação, problemas com o token", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "404": { "description": "Not Found, nenhum ingrediente encontrado", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error, alguma coisa deu errado no servidor", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } } } } } } } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } }, "schemas": { "Usuario": { "type": "object", "properties": { "nome": { "type": "string" }, "email": { "type": "string" }, "senha": { "type": "string" }, "image": { "type": "string" }, "enderecos": { "type": "array", "items": { "properties": { "rua": { "type": "string" }, "numero": { "type": "number" }, "complemento": { "type": "string" }, "CEP": { "type": "string" }, "createdAt": { "type": "string" } } } }, "pizzas_fav": { "type": "array", "items": { "properties": { "_id": { "type": "string" }, "createdAt": { "type": "string" } } } }, "createdAt": { "type": "string" }, "admin": { "type": "boolean" } } }, "UserAdress": { "type": "array", "items": { "properties": { "rua": { "type": "string" }, "numero": { "type": "number" }, "complemento": { "type": "string" }, "CEP": { "type": "string" }, "createdAt": { "type": "string" } } } }, "PizzaFav": { "type": "array", "items": { "properties": { "_id": { "type": "string" }, "createdAt": { "type": "string" } } } }, "Pizza": { "type": "object", "properties": { "nome": { "type": "string" }, "descricao": { "type": "string" }, "tamanho": { "type": "string" }, "preco_unitario": { "type": "number" }, "imagem": { "type": "string" }, "ingrediente": { "type": "array", "items": { "properties": { "_id": { "type": "string" }, "createdAt": { "type": "string" } } } }, "categoria": { "type": "array", "items": { "properties": { "_id": { "type": "string" }, "createdAt": { "type": "string" } } } }, "createdAt": { "type": "string" } } }, "ingredienteSchema": { "type": "object", "properties": { "nome": { "type": "string" }, "createdAt": { "type": "string" } } }, "IngredientePizza": { "type": "array", "items": { "properties": { "_id": { "type": "string" }, "createdAt": { "type": "string" } } } }, "CategoriaPizza": { "type": "array", "items": { "properties": { "_id": { "type": "string" }, "createdAt": { "type": "string" } } } } } } }