openapi: 3.0.0 info: description: API documentation version: "1.0.0" title: API documentation license: name: Apache 2.0 url: "http://www.apache.org/licenses/LICENSE-2.0.html" servers: - description: SwaggerHub API Auto Mocking url: "https://virtserver.swaggerhub.com/Lelberto/kaktus/1.0.0" - url: "https://api.example.com/server1" - url: "https://api.example.com/server2" tags: - name: auth description: Authentication - name: users description: Access to users paths: /auth/accessToken: post: tags: - auth summary: Access token generation requestBody: content: application/json: schema: type: object properties: refresh_token: type: string required: true responses: '200': description: Access token generated content: application/json: schema: type: object properties: access_token: type: string '404': description: Invalid refresh token content: application/json: schema: type: array items: $ref: "#/components/schemas/APIError" '500': description: Server error content: application/json: schema: type: array items: $ref: "#/components/schemas/APIError" /auth/refreshToken: post: tags: - auth summary: Refresh token and access token generation requestBody: content: application/json: schema: type: object properties: email: type: string password: type: string required: true responses: '200': description: Refresh token and access token generated content: application/json: schema: type: object properties: access_token: type: string refresh_token: type: string links: type: array items: $ref: "#/components/schemas/Link" '404': description: Email not found or invalid password content: application/json: schema: type: array items: $ref: "#/components/schemas/APIError" '500': description: Server error content: application/json: schema: type: array items: $ref: "#/components/schemas/APIError" /users: get: tags: - users summary: Gets all users responses: "200": description: OK content: application/json: schema: type: array items: $ref: "#/components/schemas/User" "500": description: Server error content: application/json: schema: type: array items: $ref: "#/components/schemas/APIError" post: tags: - users summary: Creates a new user requestBody: content: application/json: schema: type: object properties: name: type: string email: type: string password: type: string responses: "200": description: OK content: application/json: schema: type: object properties: id: type: string links: type: array items: $ref: "#/components/schemas/Link" "400": description: Validation failed content: application/json: schema: type: array items: $ref: "#/components/schemas/APIError" "404": description: User not found content: application/json: schema: type: array items: $ref: "#/components/schemas/APIError" "500": description: Server error content: application/json: schema: type: array items: $ref: "#/components/schemas/APIError" "/users/{userId}": parameters: - in: path name: userId required: true schema: type: integer get: tags: - users summary: Gets a specific user responses: "200": description: OK content: application/json: schema: type: object properties: user: $ref: "#/components/schemas/User" links: type: array items: $ref: "#/components/schemas/Link" "404": description: User not found content: application/json: schema: type: array items: $ref: "#/components/schemas/APIError" "500": description: Server error content: application/json: schema: type: array items: $ref: "#/components/schemas/APIError" put: tags: - users summary: Modifies an user requestBody: content: application/json: schema: type: object properties: name: type: string email: type: string password: type: string responses: "200": description: OK content: application/json: schema: type: object properties: id: type: string links: type: array items: $ref: "#/components/schemas/Link" "400": description: Validation failed content: application/json: schema: type: array items: $ref: "#/components/schemas/APIError" "404": description: User not found content: application/json: schema: type: array items: $ref: "#/components/schemas/APIError" "500": description: Server error content: application/json: schema: type: array items: $ref: "#/components/schemas/APIError" patch: tags: - users summary: Updates an user requestBody: content: application/json: schema: type: object properties: name: type: string email: type: string password: type: string responses: "200": description: OK content: application/json: schema: type: object properties: id: type: string links: type: array items: $ref: "#/components/schemas/Link" "400": description: Validation failed content: application/json: schema: type: array items: $ref: "#/components/schemas/APIError" "404": description: User not found content: application/json: schema: type: array items: $ref: "#/components/schemas/APIError" "500": description: Server error content: application/json: schema: type: array items: $ref: "#/components/schemas/APIError" delete: tags: - users summary: Deletes an user responses: "204": description: Deleted "404": description: User not found content: application/json: schema: type: array items: $ref: "#/components/schemas/APIError" "500": description: Server error content: application/json: schema: type: array items: $ref: "#/components/schemas/APIError" components: schemas: User: type: object properties: id: type: string name: type: string password: type: string Link: type: object properties: rel: type: string action: type: string enum: [GET, POST, PUT, PATCH, DELETE] href: type: string APIError: type: object properties: error: type: string error_description: type: string