{ "openapi": "3.0.0", "info": { "title": "API Ecomm - Product", "description": "This application will integrate the Ecomm API. Under development...", "contact": { "email": "jessicamoraes.dev@gmail.com" }, "version": "1.0.0" }, "paths": { "/products": { "post": { "security": [ { "bearerAuth": [] } ], "summary": "Product registration", "description": "Route responsible for registering a new product.", "tags": [ "Products" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProductRequest" } } } }, "responses": { "500": { "description": "Internal Server Error" }, "403": { "description": "Forbidden" }, "401": { "description": "Unauthorized" }, "400": { "description": "Bad Request" }, "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProductResponse" } } } } } }, "get": { "summary": "List of all products", "description": "Route responsible for listing all products found in the database.", "tags": [ "Products" ], "responses": { "500": { "description": "Internal Server Error" }, "404": { "description": "Not found" }, "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProductResponse" } } } } } } }, "/users": { "post": { "summary": "User registration", "description": "Route responsible for registering a new user.", "tags": [ "Users" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserRequest" } } } }, "responses": { "500": { "description": "Internal Server Error" }, "400": { "description": "Bad Request" }, "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserResponse" } } } } } } }, "/token": { "post": { "summary": "Authentication user", "description": "Route responsible for registering a new user.", "tags": [ "Users" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Token" } } } }, "responses": { "500": { "description": "Internal Server Error" }, "401": { "description": "Error with account data" }, "400": { "description": "Bad Request" }, "201": { "description": "Token account created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Token" }, "examples": { "accounts": { "value": { "token": "string" } } } } } } } } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } }, "schemas": { "UserRequest": { "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": "string" }, "password": { "type": "string" } } }, "UserResponse": { "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": "string" } } }, "ProductResponse": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "value": { "type": "number" }, "quantity": { "type": "number" }, "description": { "type": "string" }, "category": { "type": "string" }, "features": { "$ref": "#/components/schemas/FeatureResponse" }, "images": { "$ref": "#/components/schemas/ImageResponse" }, "createdDate": { "type": "string" }, "updatedDate": { "type": "string" } } }, "ImageResponse": { "type": "object", "properties": { "id": { "type": "integer" }, "url": { "type": "string" }, "description": { "type": "string" }, "createdDate": { "type": "string" }, "updatedDate": { "type": "string" } } }, "FeatureResponse": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "description": { "type": "string" }, "createdDate": { "type": "string" }, "updatedDate": { "type": "string" } } }, "ProductRequest": { "type": "object", "properties": { "name": { "type": "string" }, "value": { "type": "number" }, "quantity": { "type": "number" }, "description": { "type": "string" }, "category": { "type": "string" }, "features": { "$ref": "#/components/schemas/FeatureRequest" }, "images": { "$ref": "#/components/schemas/ImageRequest" } } }, "FeatureRequest": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" } } }, "ImageRequest": { "type": "object", "properties": { "url": { "type": "string" }, "description": { "type": "string" } } }, "Token": { "type": "object", "properties": { "email": { "type": "string" }, "password": { "type": "string" } } } } } }