basePath: / definitions: entities.LoginRequest: properties: email: type: string password: minLength: 6 type: string required: - email - password type: object entities.LoginResponse: properties: token: type: string user: $ref: '#/definitions/entities.User' type: object entities.RegisterRequest: properties: email: type: string first_name: type: string last_name: type: string password: minLength: 6 type: string required: - email - first_name - last_name - password type: object entities.Role: enum: - admin - user - moderator type: string x-enum-varnames: - RoleAdmin - RoleUser - RoleModerator entities.User: properties: created_at: type: string email: type: string first_name: type: string id: type: integer is_active: type: boolean last_name: type: string role: $ref: '#/definitions/entities.Role' updated_at: type: string type: object host: localhost:3000 info: contact: email: support@swagger.io name: API Support url: http://www.swagger.io/support description: Authentication API with Role-based Access Control license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html termsOfService: http://swagger.io/terms/ title: API E-commerce version: "1.0" paths: /api/admin/dashboard: get: consumes: - application/json produces: - application/json responses: "200": description: OK schema: additionalProperties: type: string type: object "401": description: Unauthorized schema: additionalProperties: type: string type: object "403": description: Forbidden schema: additionalProperties: type: string type: object security: - BearerAuth: [] summary: Get admin dashboard information (admin only) tags: - Admin /api/auth/login: post: consumes: - application/json description: Authenticate user and return JWT token parameters: - description: Login credentials in: body name: request required: true schema: $ref: '#/definitions/entities.LoginRequest' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/entities.LoginResponse' "400": description: Bad Request schema: additionalProperties: type: string type: object "401": description: Unauthorized schema: additionalProperties: type: string type: object summary: Login user tags: - Authentication /api/auth/register: post: consumes: - application/json description: Register a new user account parameters: - description: Registration data in: body name: request required: true schema: $ref: '#/definitions/entities.RegisterRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/entities.User' "400": description: Bad Request schema: additionalProperties: type: string type: object "409": description: Conflict schema: additionalProperties: type: string type: object summary: Register a new user tags: - Authentication /api/user/profile: get: consumes: - application/json description: Get current user's profile information produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/entities.User' "401": description: Unauthorized schema: additionalProperties: type: string type: object "404": description: Not Found schema: additionalProperties: type: string type: object security: - BearerAuth: [] summary: Get user profile tags: - User securityDefinitions: BearerAuth: in: header name: Authorization type: apiKey swagger: "2.0"