{ "openapi": "3.0.0", "info": { "title": "API BookStoreDigital", "version": "1.0.0" }, "paths": { "/BookStoreDigital/clientes": { "get": { "tags": [ "Clientes" ], "summary": "Listar clientes", "responses": { "200": { "description": "Lista de clientes", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Cliente" } }, "examples": { "exemplo": { "value": [ { "id": 0, "name": "string", "email": "string", "password": "string", "repeatpassword": "string", "cpf": "string", "endereco": "string", "dataCriacao": "datetime" } ] } } } } } } }, "post": { "tags": [ "Clientes" ], "summary": "Criar novo cliente", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Cliente" } } } }, "responses": { "201": { "description": "Cliente criado" } } } }, "/BookStoreDigital/clientes/login": { "post": { "tags": [ "Clientes" ], "summary": "Login de cliente", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginRequest" } } } }, "responses": { "200": { "description": "Login bem-sucedido" }, "401": { "description": "Credenciais inválidas" } } } }, "/BookStoreDigital/clientes/validate-token": { "get": { "tags": [ "Clientes" ], "summary": "Validar token JWT", "description": "Valida se o token JWT passado no header Authorization é válido.", "parameters": [ { "name": "Authorization", "in": "header", "required": true, "schema": { "type": "string" }, "description": "Token JWT no formato Bearer " } ], "responses": { "200": { "description": "Token válido" }, "401": { "description": "Token inválido ou ausente" } }, "security": [ { "bearerAuth": [] } ] } }, "/BookStoreDigital/clientes/{id}": { "get": { "tags": [ "Clientes" ], "summary": "Buscar cliente por ID", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Cliente encontrado", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Cliente" } } } }, "404": { "description": "Cliente não encontrado" } } }, "put": { "tags": [ "Clientes" ], "summary": "Atualizar cliente", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Cliente" } } } }, "responses": { "200": { "description": "Cliente atualizado" } } }, "delete": { "tags": [ "Clientes" ], "summary": "Remover cliente", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "204": { "description": "Cliente removido" } } } }, "/BookStoreDigital/livros": { "get": { "tags": [ "Livros" ], "summary": "Listar livros", "responses": { "200": { "description": "Lista de livros", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Livro" } }, "examples": { "exemplo": { "value": [ { "id": 0, "titulo": "string", "autor": "string", "editora": "string", "anoPublicacao": "string", "genero": "string", "sinopse": "string", "isbn": "string", "idioma": "string", "preco": 0, "imageUrl": "string", "quant": 0 } ] } } } } } } }, "post": { "tags": [ "Livros" ], "summary": "Criar novo livro", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Livro" } } } }, "responses": { "201": { "description": "Livro criado" } } } }, "/BookStoreDigital/livros/{id}": { "put": { "tags": [ "Livros" ], "summary": "Atualizar livro", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "number", "format": "long" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Livro" } } } }, "responses": { "200": { "description": "Livro atualizado" } } }, "delete": { "tags": [ "Livros" ], "summary": "Remover livro", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "204": { "description": "Livro removido" } } } }, "/BookStoreDigital/livros/{title}": { "get": { "tags": [ "Livros" ], "summary": "Buscar livro por Título", "parameters": [ { "name": "title", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Livro encontrado", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Livro" } } } }, "404": { "description": "Livro não encontrado" } } } }, "/BookStoreDigital/livros/editora/{editora}": { "get": { "tags": [ "Livros" ], "summary": "Buscar livros por Editora", "parameters": [ { "name": "editora", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Livros encontrados por editora", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Livro" } } } } }, "404": { "description": "Nenhum livro encontrado com essa editora" } } } }, "/BookStoreDigital/livros/isbn/{isbn}": { "get": { "tags": [ "Livros" ], "summary": "Buscar livros por ISBN", "parameters": [ { "name": "isbn", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Livro encontrado por ISBN", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Livro" } } } }, "404": { "description": "Livro com este ISBN não encontrado" } } } }, "/BookStoreDigital/livros/genero/{genero}": { "get": { "tags": [ "Livros" ], "summary": "Buscar livros por Gênero", "parameters": [ { "name": "genero", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Livros encontrados por gênero", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Livro" } } } } }, "404": { "description": "Nenhum livro encontrado com esse gênero" } } } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } }, "schemas": { "Cliente": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "email": { "type": "string" }, "password": { "type": "string" }, "repeatpassword": { "type": "string" }, "cpf": { "type": "string" }, "endereco": { "type": "string" }, "dataCriacao": { "type": "string", "format": "date-time" } } }, "LoginRequest": { "type": "object", "properties": { "email": { "type": "string" }, "password": { "type": "string" } }, "required": [ "email", "password" ] }, "Livro": { "type": "object", "properties": { "id": { "type": "number", "format": "long" }, "titulo": { "type": "string" }, "autor": { "type": "string" }, "editora": { "type": "string" }, "anoPublicacao": { "type": "string" }, "genero": { "type": "string" }, "sinopse": { "type": "string" }, "isbn": { "type": "string" }, "idioma": { "type": "string" }, "preco": { "type": "number", "format": "double" }, "imageUrl": { "type": "string" }, "quant": { "type": "integer" } } } } } }