{ "openapi": "3.0.0", "info": { "title": "API Gerenciamento de Apartamentos", "version": "1.0.0", "description": "API para cadastro de proprietários, login, e listagem de apartamentos disponíveis." }, "paths": { "/api/proprietarios": { "post": { "summary": "Cadastro de Proprietário", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "nome": { "type": "string" }, "email": { "type": "string" }, "senha": { "type": "string" } }, "required": ["nome", "email", "senha"] } } } }, "responses": { "201": { "description": "Proprietário cadastrado com sucesso", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "integer" }, "nome": { "type": "string" }, "email": { "type": "string" } } } } } }, "400": { "description": "Erro de validação ou e-mail duplicado", "content": { "application/json": { "schema": { "type": "object", "properties": { "erro": { "type": "string" } } } } } } } } }, "/api/login": { "post": { "summary": "Login do Proprietário", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": "string" }, "senha": { "type": "string" } }, "required": ["email", "senha"] } } } }, "responses": { "200": { "description": "Login realizado com sucesso", "content": { "application/json": { "schema": { "type": "object", "properties": { "token": { "type": "string" } } } } } }, "401": { "description": "E-mail ou senha inválidos", "content": { "application/json": { "schema": { "type": "object", "properties": { "erro": { "type": "string" } } } } } } } } }, "/api/apartamentos": { "get": { "summary": "Listar apartamentos disponíveis", "security": [{ "bearerAuth": [] }], "responses": { "200": { "description": "Lista de apartamentos disponíveis", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer" }, "nome": { "type": "string" }, "descricao": { "type": "string" }, "localizacao": { "type": "string" }, "valorDiaria": { "type": "number" } } } } } } }, "404": { "description": "Nenhum apartamento disponível", "content": { "application/json": { "schema": { "type": "object", "properties": { "erro": { "type": "string" } } } } } }, "401": { "description": "Token não fornecido ou inválido", "content": { "application/json": { "schema": { "type": "object", "properties": { "erro": { "type": "string" } } } } } } } } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } } } }