openapi: 3.0.0 info: title: All my rest api description: Rest API for experiment. version: 0.1.1 servers: - url: http://localhost/rest-php/user description: Binhusenstore end point tags: - name: user description: user paths: /user/{operation}: parameters: - name: register in: path required: true description: Path for register new user schema: type: string example: register - name: login in: path required: true description: Path for user login schema: type: string example: login - name: validate in: path required: true description: Path for validate JWT schema: type: string example: validate - name: JWT-Authorization in: header required: true description: Path for validate JWT schema: type: string example: Very long token post: tags: - user summary: Lets a user to register/validate/login requestBody: $ref: "#/components/requestBodies/user" responses: "201": description: Successfully created a new user content: application/json: schema: $ref: "#/components/schemas/Return_after_post" "200": description: JWT Token is valid content: application/json: schema: type: object properties: success: type: boolean example: true message: type: string example: Valid token "400": $ref: "#/components/responses/400Error" "401": $ref: "#/components/responses/401Error" # End of user end point components: schemas: Return_after_post: type: object properties: success: type: boolean example: true id: type: string example: "WAR22500001" user: type: object properties: email: type: string example: "WAR22500001" password: type: string name: type: string responses: 400Error: description: Invalid request content: application/json: schema: type: object properties: success: type: boolean default: false message: type: string 401Error: description: Invalid Authorization Or Unauthorization content: application/json: schema: type: object properties: success: type: boolean default: false message: type: string default: "You must be authenticated to access this resource. / Invalid email or password" 200Success: description: Success operation content: application/json: schema: type: object properties: success: type: boolean default: true message: type: string default: Update source success 404Error: description: Source not found content: application/json: schema: type: object properties: success: type: boolean default: false message: type: string default: Source not found getuser200: description: Success operation content: application/json: schema: type: object properties: success: type: boolean default: true data: type: array items: $ref: "#/components/schemas/user" requestBodies: user: required: true content: application/json: schema: type: object properties: password: type: string email: type: string