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/note description: note end point tags: - name: note description: my own note paths: /note: parameters: - name: JWT-Authorization in: header required: true description: JWT Token schema: type: string example: Very long token post: tags: - note summary: Lets user post a new note requestBody: $ref: "#/components/requestBodies/note" responses: "201": description: Successfully created a new note content: application/json: schema: $ref: "#/components/schemas/Return_after_post" "400": $ref: "#/components/responses/400Error" "401": $ref: "#/components/responses/401Error" /notes: parameters: - name: JWT-Authorization in: header required: true description: JWT Token schema: type: string example: Very long token get: tags: - note summary: Get all note. parameters: - name: search in: query description: the user of id required: true explode: true schema: type: string default: learn typescript responses: "200": $ref: "#/components/responses/getnote200" "401": $ref: "#/components/responses/401Error" "404": $ref: "#/components/responses/404Error" /note/{id}: parameters: - name: id in: path required: true description: The ID of the note schema: type: string example: "WAR220203902" - name: JWT-Authorization in: header required: true description: JWT Token schema: type: string example: Very long token get: tags: - note summary: Get note by id. responses: "200": $ref: "#/components/responses/getnote200" "404": $ref: "#/components/responses/404Error" "401": $ref: "#/components/responses/401Error" put: tags: - note summary: Update note by id requestBody: $ref: "#/components/requestBodies/note" responses: "201": $ref: "#/components/responses/200Success" "400": $ref: "#/components/responses/400Error" "401": $ref: "#/components/responses/401Error" "404": $ref: "#/components/responses/404Error" delete: tags: - note summary: Delete note by id responses: "201": $ref: "#/components/responses/200Success" "400": $ref: "#/components/responses/400Error" "401": $ref: "#/components/responses/401Error" "404": $ref: "#/components/responses/404Error" # End of note end point /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" note: type: object properties: id: type: string example: "WAR22500001" tanggal: type: string isi: type: string 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." 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 getnote200: description: Success operation content: application/json: schema: type: object properties: success: type: boolean default: true data: type: array items: $ref: "#/components/schemas/note" requestBodies: note: required: true content: application/json: schema: type: object properties: isi: type: string user: required: true content: application/json: schema: type: object properties: password: type: string email: type: string