Last active
November 21, 2022 03:13
-
-
Save joesoeph/782147be8f6b06b4efde3d687c022be3 to your computer and use it in GitHub Desktop.
KK Tech Assessment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openapi: 3.0.0 | |
info: | |
description: "Karyakarsa Tech Test Assessment - SMKN 1 Wakanda API Specification" | |
version: 1.0.0 | |
title: SMKN 1 Wakanda API Specification | |
contact: | |
email: yusuf@wakanda.sch.id | |
servers: | |
- url: https://api.wakanda.sch.id/v1 | |
description: Production server | |
- url: https://api-stagging.wakanda.sch.id/v1 | |
description: Staging server | |
- url: https://api-dev.wakanda.sch.id/v1 | |
description: Development server | |
tags: | |
- name: auth | |
description: Everything about auth endpoint | |
- name: schedules | |
description: Everything about schedules endpoint | |
paths: | |
/auth/login: | |
post: | |
tags: | |
- auth | |
summary: Auth Login | |
description: "" | |
requestBody: | |
$ref: "#/components/requestBodies/login" | |
responses: | |
"200": | |
description: OK | |
content: | |
application/json: | |
schema: | |
type: object | |
properties: | |
access_token: | |
type: string | |
default: | |
$ref: "#/components/responses/default" | |
/auth/change-password: | |
put: | |
security: | |
- bearerAuth: [] | |
tags: | |
- auth | |
summary: Auth change password | |
description: "" | |
requestBody: | |
$ref: "#/components/requestBodies/changePassword" | |
responses: | |
"204": | |
$ref: "#/components/responses/204" | |
default: | |
$ref: "#/components/responses/default" | |
/auth/me: | |
get: | |
security: | |
- bearerAuth: [] | |
tags: | |
- auth | |
description: Get currently information of current user logged in | |
responses: | |
"200": | |
description: Success Response | |
content: | |
application/json: | |
schema: | |
$ref: "#/components/schemas/me" | |
default: | |
$ref: "#/components/responses/default" | |
/schedules: | |
get: | |
security: | |
- bearerAuth: [] | |
tags: | |
- schedules | |
description: Get list of schedules | |
parameters: | |
- name: q | |
in: query | |
description: Teacher name or subject name | |
schema: | |
type: string | |
example: 'upacara' | |
- name: semester | |
in: query | |
schema: | |
type: integer | |
example: 1 | |
- name: year | |
in: query | |
schema: | |
type: integer | |
example: 2020 | |
responses: | |
"200": | |
description: Success Response | |
content: | |
application/json: | |
schema: | |
$ref: "#/components/schemas/schedules" | |
default: | |
$ref: "#/components/responses/default" | |
components: | |
securitySchemes: | |
bearerAuth: | |
type: http | |
scheme: bearer | |
bearerFormat: JWT | |
requestBodies: | |
login: | |
content: | |
application/json: | |
schema: | |
$ref: "#/components/schemas/login" | |
description: Login request body | |
required: true | |
changePassword: | |
content: | |
application/json: | |
schema: | |
type: object | |
required: | |
- old_password | |
- new_password | |
- confirm_password | |
properties: | |
old_password: | |
type: string | |
format: password | |
example: new secret | |
new_password: | |
type: string | |
format: password | |
example: secret | |
confirm_password: | |
type: string | |
format: password | |
example: secret | |
responses: | |
default: | |
description: Runtime error | |
content: | |
application/json: | |
schema: | |
$ref: "#/components/schemas/runtimeError" | |
"204": | |
description: No Content | |
schemas: | |
runtimeError: | |
type: object | |
properties: | |
code: | |
type: integer | |
format: int32 | |
type: | |
type: string | |
message: | |
type: string | |
login: | |
type: object | |
required: | |
- nis | |
- password | |
properties: | |
nis: | |
type: integer | |
example: 12345678 | |
password: | |
type: string | |
format: password | |
example: secret | |
me: | |
type: object | |
properties: | |
id: | |
type: integer | |
nis: | |
type: integer | |
example: 12345678 | |
fullname: | |
type: string | |
example: "Purwoto" | |
semester: | |
type: integer | |
example: 1 | |
major: | |
type: string | |
example: RPL | |
created_at: | |
type: string | |
format: datetime | |
schedule: | |
type: object | |
properties: | |
datetime: | |
type: string | |
format: date-time | |
subject: | |
type: string | |
example: "Upacara" | |
teacher: | |
type: string | |
example: "Mangazad" | |
schedules: | |
type: array | |
items: | |
$ref: "#/components/schemas/schedule" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment