openapi: "3.0.0" info: title: "API Proyectos arquitectura y construcción" version: "1.0.0" description: "API REST para gestión de proyectos de arquitectura y construcción" paths: /auth/login: post: tags: - "auth" summary: "Login" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AuthBody" responses: 200: description: "OK" content: application/json: schema: $ref: "#/components/schemas/AuthResponse" 400: description: "Bad Request" 500: description: "Internal Server Error" /auth/register: post: tags: - "auth" summary: "Register" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AuthBody" responses: 201: description: "Created" content: application/json: schema: $ref: "#/components/schemas/AuthResponse" 400: description: "Bad Request" 500: description: "Internal Server Error" /users: get: tags: - "users" summary: "Get all users" security: - bearerAuth: [] responses: 200: description: "OK" content: application/json: schema: $ref: "#/components/schemas/UsersResponse" 401: description: "Unauthorized" 500: description: "Internal Server Error" post: tags: - "users" summary: "Create a user" security: - bearerAuth: [] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AuthBody" responses: 201: description: "Created" content: application/json: schema: $ref: "#/components/schemas/User" 400: description: "Bad Request" 401: description: "Unauthorized" 500: description: "Internal Server Error" /users/{uid}: get: tags: - "users" summary: "Get a user" security: - bearerAuth: [] parameters: - name: "uid" in: "path" required: true schema: type: "number" format: "uid" example: 1 responses: 200: description: "OK" content: application/json: schema: $ref: "#/components/schemas/User" 401: description: "Unauthorized" 404: description: "Not Found" 500: description: "Internal Server Error" put: tags: - "users" summary: "Update a user" security: - bearerAuth: [] parameters: - name: "uid" in: "path" required: true schema: type: "number" format: "uid" example: 1 requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AuthBody" responses: 200: description: "OK" content: application/json: schema: $ref: "#/components/schemas/User" 400: description: "Bad Request" 401: description: "Unauthorized" 404: description: "Not Found" 500: description: "Internal Server Error" /projects: get: tags: - "projects" summary: "Get all projects" security: - bearerAuth: [] responses: 200: description: "OK" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/Project" 401: description: "Unauthorized" 500: description: "Internal Server Error" post: tags: - "projects" summary: "Create a new project" security: - bearerAuth: [] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ProjectBody" responses: 201: description: "Created" content: application/json: schema: $ref: "#/components/schemas/Project" 400: description: "Bad Request" 401: description: "Unauthorized" 500: description: "Internal Server Error" /project/{uid}: get: tags: - "projects" summary: "Get a specific project by ID" security: - bearerAuth: [] parameters: - name: "uid" in: "path" required: true schema: type: "string" format: "uid" example: "e748fdbf-44b5-4711-b7b9-ef04594b5298" responses: 200: description: "OK" content: application/json: schema: $ref: "#/components/schemas/Project" 401: description: "Unauthorized" 404: description: "Not Found" 500: description: "Internal Server Error" /projects/{uid}: delete: tags: - "projects" summary: "Delete a specific project" security: - bearerAuth: [] parameters: - name: "uid" in: "path" required: true schema: type: "string" format: "uuid" example: "e748fdbf-44b5-4711-b7b9-ef04594b5298" responses: 204: description: "No Content" 401: description: "Unauthorized" 404: description: "Not Found" 500: description: "Internal Server Error" components: securitySchemes: bearerAuth: type: "http" scheme: "bearer" bearerFormat: "JWT" schemas: AuthResponse: type: "object" properties: token: type: "string" example: "eyJhbGciOi..." AuthBody: type: "object" properties: email: type: "string" format: "email" example: "test1@domain.com" password: type: "string" example: "123123" User: type: "object" properties: uid: type: "number" format: "uid" example: 1 email: type: "string" format: "email" example: "test2@domain.com" password: type: "string" example: "$2a$10$2wS6XBG6wej2diNGPZPaD.J63zU3K16hTkh7Zpy3xpK.o.2c6MKUW" UsersResponse: type: "object" properties: email: type: "string" format: "email" example: "test1@test.com" users: type: "array" items: $ref: "#/components/schemas/User" Project: type: "object" properties: uid: type: "string" format: "uuid" example: "e748fdbf-44b5-4711-b7b9-ef04594b5298" title: type: "string" example: "Proyecto 1" description: type: "string" example: "Description project 1" imgurl: type: "string" format: "uri" example: "https://example.com/image.jpg" createdAt: type: "string" format: "date-time" updatedAt: type: "string" format: "date-time" ProjectBody: type: "object" required: ["title", "description", "imgurl"] properties: title: type: "string" example: "Proyecto 1" minLength: 1 maxLength: 100 description: type: "string" example: "Description project 1" minLength: 1 maxLength: 500 imgurl: type: "string" format: "uri" example: "https://example.com/image.jpg"