{ "schemes": [ "http", "https" ], "swagger": "2.0", "info": { "description": "Dokumentasi API backend Sistem Informasi Sekolah menggunakan Golang Fiber, GORM, PostgreSQL, dan JWT.", "title": "API Sistem Informasi Sekolah", "contact": { "name": "Praktikum Pemrograman III", "email": "praktikum@example.com" }, "version": "1.0" }, "host": "127.0.0.1:3000", "basePath": "/", "paths": { "/api/absensi/": { "get": { "description": "Mengambil seluruh data absensi. Dapat disaring berdasarkan kelas, tanggal, status persetujuan, dan siswa. Route ini terproteksi jika diakses via route ber-auth, namun absensiRoute juga didaftarkan sebagai publicAPI di main.go.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Absensi" ], "summary": "Ambil semua data absensi", "parameters": [ { "type": "string", "description": "Filter ID Kelas", "name": "kelas_id", "in": "query" }, { "type": "string", "description": "Filter Tanggal (YYYY-MM-DD)", "name": "tanggal", "in": "query" }, { "type": "string", "description": "Filter Status Persetujuan (e.g. Pending/Disetujui/Ditolak)", "name": "status_persetujuan", "in": "query" }, { "type": "integer", "description": "Filter ID Siswa", "name": "siswa_id", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.AbsensiResponseList" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "post": { "description": "Menambahkan data absensi baru atau mengajukan izin.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Absensi" ], "summary": "Tambah data absensi / ajukan izin", "parameters": [ { "description": "Payload data absensi", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Absensi" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/model.AbsensiResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/absensi/bulk": { "post": { "description": "Menyimpan atau memperbarui data absensi banyak siswa sekaligus di suatu tanggal.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Absensi" ], "summary": "Simpan absensi kelas secara bulk", "parameters": [ { "description": "Payload bulk absensi", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.BulkSaveInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/helpers.SwaggerSuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/absensi/{id}": { "get": { "description": "Mengambil detail data satu absensi berdasarkan ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Absensi" ], "summary": "Ambil data absensi berdasarkan ID", "parameters": [ { "type": "integer", "description": "ID Absensi", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.AbsensiResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "delete": { "description": "Menghapus data absensi berdasarkan ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Absensi" ], "summary": "Hapus data absensi", "parameters": [ { "type": "integer", "description": "ID Absensi", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/helpers.SwaggerSuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/absensi/{id}/approve": { "put": { "description": "Mengubah status persetujuan absensi (e.g. Disetujui/Ditolak).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Absensi" ], "summary": "Setujui atau tolak izin absensi", "parameters": [ { "type": "integer", "description": "ID Absensi", "name": "id", "in": "path", "required": true }, { "description": "Payload status persetujuan", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.ApproveRejectInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.AbsensiResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/admin/dashboard": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Mengambil statistik ringkas dashboard untuk role Admin (e.g. jumlah guru, siswa, kelas, mapel).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Dashboard" ], "summary": "Ambil data dashboard admin", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/helpers.SwaggerSuccessResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/helpers.SwaggerError403Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/auth/change-password": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Mengubah password user yang sedang login menggunakan token JWT.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Ubah password user", "parameters": [ { "description": "Payload ubah password", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/service.ChangePasswordInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/helpers.SwaggerSuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/helpers.SwaggerError403Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/auth/login": { "post": { "description": "Melakukan autentikasi menggunakan Email/NIP/NIS/Username dan Password untuk mendapatkan JWT token.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Login user", "parameters": [ { "description": "Payload login user", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/service.LoginInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.LoginSuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/auth/register": { "post": { "description": "Mendaftarkan akun user baru (khusus untuk role guru). Pendaftaran mandiri hanya diperbolehkan untuk role guru.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Register user baru", "parameters": [ { "description": "Payload register user", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/service.RegisterInput" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/model.RegisterSuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/guru/": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Mengambil seluruh data guru. Mendukung parameter pencarian.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Guru" ], "summary": "Ambil semua data guru", "parameters": [ { "type": "string", "description": "Cari berdasarkan nama atau NIP", "name": "search", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.GuruResponseList" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Menambahkan data guru baru dan membuat user account dengan password acak sementara.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Guru" ], "summary": "Tambah data guru", "parameters": [ { "description": "Payload data guru", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Guru" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/model.GuruResponseCreated" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/guru/dashboard": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Mengambil statistik ringkas dashboard untuk Guru (e.g. jadwal mengajar, permohonan izin pending).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Dashboard" ], "summary": "Ambil data dashboard guru", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/helpers.SwaggerSuccessResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/helpers.SwaggerError403Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/guru/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Mengambil detail data satu guru berdasarkan ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Guru" ], "summary": "Ambil data guru berdasarkan ID", "parameters": [ { "type": "integer", "description": "ID Guru", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.GuruResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Mengubah data guru berdasarkan ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Guru" ], "summary": "Ubah data guru", "parameters": [ { "type": "integer", "description": "ID Guru", "name": "id", "in": "path", "required": true }, { "description": "Payload data guru", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Guru" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.GuruResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Menghapus data guru beserta user account terkait berdasarkan ID. Hanya dapat diakses oleh Admin.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Guru" ], "summary": "Hapus data guru", "parameters": [ { "type": "integer", "description": "ID Guru", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/helpers.SwaggerSuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/helpers.SwaggerError403Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/jadwal/": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Mengambil seluruh data jadwal pelajaran dengan berbagai filter opsional.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Jadwal" ], "summary": "Ambil semua data jadwal", "parameters": [ { "type": "string", "description": "Filter ID Kelas", "name": "kelas_id", "in": "query" }, { "type": "string", "description": "Filter ID Mapel", "name": "mapel_id", "in": "query" }, { "type": "string", "description": "Filter ID Guru", "name": "guru_id", "in": "query" }, { "type": "string", "description": "Filter Hari", "name": "hari", "in": "query" }, { "type": "string", "description": "Filter Tahun Ajaran (e.g. 2026/2027)", "name": "tahun_ajaran", "in": "query" }, { "type": "string", "description": "Filter Semester (e.g. Ganjil/Genap)", "name": "semester", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.JadwalResponseList" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Menambahkan data jadwal pelajaran baru.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Jadwal" ], "summary": "Tambah data jadwal", "parameters": [ { "description": "Payload data jadwal", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Jadwal" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/model.JadwalResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/jadwal/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Mengambil detail data satu jadwal pelajaran berdasarkan ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Jadwal" ], "summary": "Ambil data jadwal berdasarkan ID", "parameters": [ { "type": "integer", "description": "ID Jadwal", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.JadwalResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Mengubah data jadwal pelajaran berdasarkan ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Jadwal" ], "summary": "Ubah data jadwal", "parameters": [ { "type": "integer", "description": "ID Jadwal", "name": "id", "in": "path", "required": true }, { "description": "Payload data jadwal", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Jadwal" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.JadwalResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Menghapus data jadwal pelajaran berdasarkan ID. Hanya dapat diakses oleh Admin.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Jadwal" ], "summary": "Hapus data jadwal", "parameters": [ { "type": "integer", "description": "ID Jadwal", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/helpers.SwaggerSuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/helpers.SwaggerError403Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/kelas/": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Mengambil seluruh data kelas. Mendukung pencarian nama kelas dan filter tingkat.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Kelas" ], "summary": "Ambil semua data kelas", "parameters": [ { "type": "string", "description": "Cari berdasarkan nama kelas", "name": "search", "in": "query" }, { "type": "string", "description": "Filter tingkat kelas (e.g. X, XI, XII)", "name": "tingkat", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.KelasResponseList" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Menambahkan data kelas baru.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Kelas" ], "summary": "Tambah data kelas", "parameters": [ { "description": "Payload data kelas", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Kelas" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/model.KelasResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/kelas/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Mengambil detail data satu kelas berdasarkan ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Kelas" ], "summary": "Ambil data kelas berdasarkan ID", "parameters": [ { "type": "integer", "description": "ID Kelas", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.KelasResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Mengubah data kelas berdasarkan ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Kelas" ], "summary": "Ubah data kelas", "parameters": [ { "type": "integer", "description": "ID Kelas", "name": "id", "in": "path", "required": true }, { "description": "Payload data kelas", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Kelas" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.KelasResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Menghapus data kelas berdasarkan ID. Hanya dapat diakses oleh Admin.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Kelas" ], "summary": "Hapus data kelas", "parameters": [ { "type": "integer", "description": "ID Kelas", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/helpers.SwaggerSuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/helpers.SwaggerError403Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/mapel/": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Mengambil seluruh data mata pelajaran. Mendukung pencarian.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Mapel" ], "summary": "Ambil semua data mapel", "parameters": [ { "type": "string", "description": "Cari berdasarkan nama mapel atau kode", "name": "search", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.MapelResponseList" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Menambahkan data mata pelajaran baru.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Mapel" ], "summary": "Tambah data mapel", "parameters": [ { "description": "Payload data mapel", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Mapel" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/model.MapelResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/mapel/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Mengambil detail data satu mata pelajaran berdasarkan ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Mapel" ], "summary": "Ambil data mapel berdasarkan ID", "parameters": [ { "type": "integer", "description": "ID Mapel", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.MapelResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Mengubah data mata pelajaran berdasarkan ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Mapel" ], "summary": "Ubah data mapel", "parameters": [ { "type": "integer", "description": "ID Mapel", "name": "id", "in": "path", "required": true }, { "description": "Payload data mapel", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Mapel" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.MapelResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Menghapus data mata pelajaran berdasarkan ID. Hanya dapat diakses oleh Admin.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Mapel" ], "summary": "Hapus data mapel", "parameters": [ { "type": "integer", "description": "ID Mapel", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/helpers.SwaggerSuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/helpers.SwaggerError403Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/nilai/": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Mengambil seluruh data nilai siswa berdasarkan filter kelas, mapel, siswa, dll. Guru hanya dapat melihat kelas/mapel yang diajarkannya, sedangkan siswa hanya dapat melihat nilainya sendiri.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Nilai" ], "summary": "Ambil semua data nilai", "parameters": [ { "type": "string", "description": "Filter ID Kelas", "name": "kelas_id", "in": "query" }, { "type": "string", "description": "Filter ID Mapel", "name": "mapel_id", "in": "query" }, { "type": "string", "description": "Filter ID Siswa", "name": "siswa_id", "in": "query" }, { "type": "string", "description": "Filter Tahun Ajaran (e.g. 2026/2027)", "name": "tahun_ajaran", "in": "query" }, { "type": "string", "description": "Filter Semester (e.g. Ganjil/Genap)", "name": "semester", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.NilaiResponseList" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Menambahkan data nilai baru untuk siswa. Hanya guru pengampu/wali kelas/admin yang diijinkan mengisi nilai.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Nilai" ], "summary": "Tambah data nilai", "parameters": [ { "description": "Payload data nilai", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Nilai" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/model.NilaiResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/nilai/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Mengambil detail data satu nilai berdasarkan ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Nilai" ], "summary": "Ambil data nilai berdasarkan ID", "parameters": [ { "type": "integer", "description": "ID Nilai", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.NilaiResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Mengubah data nilai siswa berdasarkan ID. Hanya dapat diubah oleh Guru pengampu atau Admin.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Nilai" ], "summary": "Ubah data nilai", "parameters": [ { "type": "integer", "description": "ID Nilai", "name": "id", "in": "path", "required": true }, { "description": "Payload data nilai", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Nilai" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.NilaiResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Menghapus data nilai siswa berdasarkan ID. Hanya dapat dihapus oleh Admin (RequireAdmin).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Nilai" ], "summary": "Hapus data nilai", "parameters": [ { "type": "integer", "description": "ID Nilai", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/helpers.SwaggerSuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/helpers.SwaggerError403Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/perizinan/": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Mengambil seluruh data perizinan yang relevan bagi user yang sedang login (siswa hanya melihat miliknya, guru melihat data kelasnya/seluruhnya).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Perizinan" ], "summary": "Ambil data perizinan", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.PerizinanResponseList" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Mengajukan perizinan baru (misal izin sakit/keperluan keluarga) untuk siswa.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Perizinan" ], "summary": "Ajukan permohonan perizinan", "parameters": [ { "description": "Payload perizinan", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Perizinan" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/model.PerizinanResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/perizinan/{id}/approve": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Mengubah status persetujuan perizinan siswa. Hanya dapat dilakukan oleh Guru.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Perizinan" ], "summary": "Setujui atau tolak permohonan perizinan", "parameters": [ { "type": "integer", "description": "ID Perizinan", "name": "id", "in": "path", "required": true }, { "description": "Payload persetujuan", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.ApproveRejectPerizinanInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.PerizinanResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/profile/": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Mengambil informasi profil lengkap (Guru/Siswa/Admin) berdasarkan JWT token yang dikirimkan.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Profile" ], "summary": "Ambil profil user yang sedang login", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/helpers.SwaggerSuccessResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Memperbarui data alamat normalization dan nomor HP profil (khusus role Guru atau Siswa).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Profile" ], "summary": "Perbarui profil user yang sedang login", "parameters": [ { "description": "Payload perbaruan profil", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.ProfileUpdateInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/helpers.SwaggerSuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/helpers.SwaggerError403Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/profile/photo": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Mengunggah berkas foto profil baru (Max 2MB, format JPG/JPEG/PNG) untuk user (Guru/Siswa) yang sedang login.", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "Profile" ], "summary": "Unggah foto profil user", "parameters": [ { "type": "file", "description": "Berkas gambar foto profil", "name": "photo", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/helpers.SwaggerSuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/helpers.SwaggerError403Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/school-profile/": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Mengambil informasi profil sekolah (ID=1). Jika belum ada di database, akan mengembalikan profil default.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "School Profile" ], "summary": "Ambil profil sekolah", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.SchoolResponseSingle" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Memperbarui data profil sekolah (ID=1). Hanya dapat diakses oleh Admin.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "School Profile" ], "summary": "Perbarui profil sekolah", "parameters": [ { "description": "Payload profil sekolah", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.SchoolProfile" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.SchoolResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/helpers.SwaggerError403Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/siswa": { "get": { "description": "Mengambil seluruh data siswa. Mendukung parameter pencarian dan filter kelas. Route ini dapat diakses secara publik, namun Guru/Wali Kelas akan mendapatkan data terbatas sesuai kelas masing-masing jika login.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Siswa" ], "summary": "Ambil semua data siswa", "parameters": [ { "type": "string", "description": "Cari berdasarkan nama atau NIS", "name": "search", "in": "query" }, { "type": "string", "description": "Filter berdasarkan ID kelas", "name": "kelas_id", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.SiswaResponseList" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Menambahkan data siswa baru dan membuat user account dengan password acak sementara. Hanya dapat diakses oleh user yang terautentikasi (JWT).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Siswa" ], "summary": "Tambah data siswa", "parameters": [ { "description": "Payload data siswa", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Siswa" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/model.SiswaResponseCreated" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/siswa/dashboard": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Mengambil statistik ringkas dashboard untuk Siswa (e.g. kelas, nilai rata-rata, absensi, jadwal hari ini).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Dashboard" ], "summary": "Ambil data dashboard siswa", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/helpers.SwaggerSuccessResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/helpers.SwaggerError403Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/siswa/{id}": { "get": { "description": "Mengambil detail data satu siswa berdasarkan ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Siswa" ], "summary": "Ambil data siswa berdasarkan ID", "parameters": [ { "type": "integer", "description": "ID Siswa", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.SiswaResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Mengubah data siswa berdasarkan ID. Hanya dapat diakses oleh user yang terautentikasi (JWT).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Siswa" ], "summary": "Ubah data siswa", "parameters": [ { "type": "integer", "description": "ID Siswa", "name": "id", "in": "path", "required": true }, { "description": "Payload data siswa", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Siswa" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.SiswaResponseSingle" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Menghapus data siswa beserta user account terkait berdasarkan ID. Hanya dapat diakses oleh Admin (JWT + Admin role).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Siswa" ], "summary": "Hapus data siswa", "parameters": [ { "type": "integer", "description": "ID Siswa", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/helpers.SwaggerSuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/helpers.SwaggerError403Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/users/": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Mengambil daftar seluruh user account (Admin, Guru, Siswa) beserta nama asli dan identifier (NIP/NIS/Email). Hanya dapat diakses oleh Admin.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User Management" ], "summary": "Ambil semua data user account", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/helpers.SwaggerSuccessResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/handler.UserResponse" } } } } ] } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/helpers.SwaggerError403Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/users/{id}/reset-password": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Mereset password user berdasarkan ID ke password default berdasarkan role (e.g. Guru123! untuk guru, Siswa123! untuk siswa). Hanya dapat diakses oleh Admin.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User Management" ], "summary": "Reset password user ke password default", "parameters": [ { "type": "integer", "description": "ID User", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/helpers.SwaggerSuccessResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/helpers.SwaggerError403Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } }, "/api/users/{id}/status": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Mengaktifkan atau menonaktifkan user account berdasarkan ID. Hanya dapat diakses oleh Admin. Administrator tidak dapat dinonaktifkan.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User Management" ], "summary": "Perbarui status keaktifan user", "parameters": [ { "type": "integer", "description": "ID User", "name": "id", "in": "path", "required": true }, { "description": "Payload status aktif", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.UpdateStatusInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/helpers.SwaggerSuccessResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.User" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/helpers.SwaggerError400Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/helpers.SwaggerError401Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/helpers.SwaggerError403Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/helpers.SwaggerError404Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/helpers.SwaggerError500Response" } } } } } }, "definitions": { "handler.ApproveRejectInput": { "type": "object", "properties": { "status_persetujuan": { "type": "string", "example": "Disetujui" } } }, "handler.ApproveRejectPerizinanInput": { "type": "object", "properties": { "keterangan_guru": { "type": "string", "example": "Izin disetujui, semoga lekas sembuh." }, "status": { "type": "string", "example": "Disetujui" } } }, "handler.BulkSaveInput": { "type": "object", "properties": { "records": { "type": "array", "items": { "$ref": "#/definitions/model.Absensi" } }, "tanggal": { "type": "string", "example": "2026-07-15" } } }, "handler.ProfileUpdateInput": { "type": "object", "properties": { "alamat_detail": { "type": "string", "example": "Jl. Diponegoro No. 25" }, "desa": { "type": "string", "example": "Sidorejo Lor" }, "kabupaten": { "type": "string", "example": "Salatiga" }, "kecamatan": { "type": "string", "example": "Sidorejo" }, "no_hp": { "type": "string", "example": "081234567890" }, "provinsi": { "type": "string", "example": "Jawa Tengah" } } }, "handler.UpdateStatusInput": { "type": "object", "properties": { "is_active": { "type": "boolean", "example": true } } }, "handler.UserResponse": { "type": "object", "properties": { "id": { "type": "integer", "example": 1 }, "identifier": { "type": "string", "example": "GR001" }, "is_active": { "type": "boolean", "example": true }, "name": { "type": "string", "example": "Ahmad Guru" }, "role": { "type": "string", "example": "guru" } } }, "helpers.SwaggerError400Response": { "type": "object", "properties": { "message": { "type": "string", "example": "Input tidak valid" }, "success": { "type": "boolean", "example": false } } }, "helpers.SwaggerError401Response": { "type": "object", "properties": { "message": { "type": "string", "example": "Token tidak ditemukan atau tidak valid" }, "success": { "type": "boolean", "example": false } } }, "helpers.SwaggerError403Response": { "type": "object", "properties": { "code": { "type": "string", "example": "ERR_PERMISSION_DENIED" }, "message": { "type": "string", "example": "Akses ditolak: Anda tidak memiliki akses untuk fitur ini" }, "success": { "type": "boolean", "example": false } } }, "helpers.SwaggerError404Response": { "type": "object", "properties": { "message": { "type": "string", "example": "Data tidak ditemukan" }, "success": { "type": "boolean", "example": false } } }, "helpers.SwaggerError500Response": { "type": "object", "properties": { "message": { "type": "string", "example": "Terjadi kesalahan internal pada server" }, "success": { "type": "boolean", "example": false } } }, "helpers.SwaggerSuccessResponse": { "type": "object", "properties": { "data": {}, "message": { "type": "string", "example": "Berhasil memproses data" }, "success": { "type": "boolean", "example": true } } }, "model.Absensi": { "type": "object", "properties": { "created_at": { "type": "string", "example": "2026-07-15T19:00:00Z" }, "id": { "type": "integer", "example": 1 }, "keterangan": { "description": "detail alasan jika Sakit/Izin", "type": "string", "example": "Hadir tepat waktu" }, "siswa": { "$ref": "#/definitions/model.Siswa" }, "siswa_id": { "type": "integer", "example": 1 }, "status": { "description": "\"Hadir\", \"Sakit\", \"Izin\", \"Alpa\"", "type": "string", "example": "Hadir" }, "status_persetujuan": { "description": "\"Pending\", \"Disetujui\", \"Ditolak\"", "type": "string", "example": "Disetujui" }, "tanggal": { "description": "format: YYYY-MM-DD", "type": "string", "example": "2026-07-15" }, "updated_at": { "type": "string", "example": "2026-07-15T19:00:00Z" } } }, "model.AbsensiResponseList": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.Absensi" } }, "message": { "type": "string", "example": "Berhasil mengambil data absensi" }, "success": { "type": "boolean", "example": true } } }, "model.AbsensiResponseSingle": { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Absensi" }, "message": { "type": "string", "example": "Berhasil mengambil detail absensi" }, "success": { "type": "boolean", "example": true } } }, "model.Guru": { "type": "object", "properties": { "alamat": { "description": "Deprecated Database Columns (Retained for Non-Destructive Migrations)", "type": "string", "example": "Jl. Diponegoro No. 25" }, "alamat_detail": { "type": "string", "example": "Jl. Diponegoro No. 25" }, "created_at": { "type": "string", "example": "2026-07-15T19:00:00Z" }, "desa": { "type": "string", "example": "Sidorejo Lor" }, "gelar": { "type": "string", "example": "S.Pd." }, "id": { "type": "integer", "example": 1 }, "jenis_kelamin": { "type": "string", "example": "Laki-laki" }, "kabupaten": { "type": "string", "example": "Salatiga" }, "kecamatan": { "type": "string", "example": "Sidorejo" }, "mapel_ids": { "description": "Virtual field for frontend multiselect checkboxes", "type": "array", "items": { "type": "integer" }, "example": [ 1, 2 ] }, "nama": { "type": "string", "example": "Ahmad Guru" }, "nip": { "type": "string", "example": "GR001" }, "no_hp": { "type": "string", "example": "081234567890" }, "photo_url": { "type": "string", "example": "/uploads/profile/guru_1.jpg" }, "provinsi": { "description": "Address Normalization Fields", "type": "string", "example": "Jawa Tengah" }, "updated_at": { "type": "string", "example": "2026-07-15T19:00:00Z" }, "user": { "$ref": "#/definitions/model.User" }, "user_id": { "type": "integer", "example": 3 } } }, "model.GuruResponseCreated": { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Guru" }, "message": { "type": "string", "example": "Guru berhasil ditambahkan" }, "success": { "type": "boolean", "example": true }, "temporary_password": { "type": "string", "example": "Guru123!" } } }, "model.GuruResponseList": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.Guru" } }, "message": { "type": "string", "example": "Berhasil mengambil data guru" }, "success": { "type": "boolean", "example": true } } }, "model.GuruResponseSingle": { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Guru" }, "message": { "type": "string", "example": "Berhasil mengambil detail guru" }, "success": { "type": "boolean", "example": true } } }, "model.Jadwal": { "type": "object", "properties": { "created_at": { "type": "string", "example": "2026-07-15T19:00:00Z" }, "guru": { "$ref": "#/definitions/model.Guru" }, "guru_id": { "type": "integer", "example": 1 }, "hari": { "type": "string", "example": "Senin" }, "id": { "type": "integer", "example": 1 }, "jam_mulai": { "type": "string", "example": "07:00" }, "jam_selesai": { "type": "string", "example": "09:00" }, "kelas": { "$ref": "#/definitions/model.Kelas" }, "kelas_id": { "type": "integer", "example": 1 }, "mapel": { "$ref": "#/definitions/model.Mapel" }, "mapel_id": { "type": "integer", "example": 1 }, "semester": { "type": "string", "example": "Ganjil" }, "tahun_ajaran": { "type": "string", "example": "2026/2027" }, "updated_at": { "type": "string", "example": "2026-07-15T19:00:00Z" } } }, "model.JadwalResponseList": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.Jadwal" } }, "message": { "type": "string", "example": "Berhasil mengambil data jadwal pelajaran" }, "success": { "type": "boolean", "example": true } } }, "model.JadwalResponseSingle": { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Jadwal" }, "message": { "type": "string", "example": "Berhasil mengambil detail jadwal pelajaran" }, "success": { "type": "boolean", "example": true } } }, "model.Kelas": { "type": "object", "properties": { "created_at": { "type": "string", "example": "2026-07-15T19:00:00Z" }, "id": { "type": "integer", "example": 1 }, "jurusan": { "type": "string", "example": "Rekayasa Perangkat Lunak" }, "kapasitas": { "type": "integer", "example": 36 }, "nama_kelas": { "type": "string", "example": "X RPL 1" }, "tingkat": { "type": "string", "example": "X" }, "total_siswa": { "type": "integer", "example": 32 }, "updated_at": { "type": "string", "example": "2026-07-15T19:00:00Z" }, "wali_kelas": { "$ref": "#/definitions/model.Guru" }, "wali_kelas_id": { "type": "integer", "example": 1 } } }, "model.KelasResponseList": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.Kelas" } }, "message": { "type": "string", "example": "Berhasil mengambil data kelas" }, "success": { "type": "boolean", "example": true } } }, "model.KelasResponseSingle": { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Kelas" }, "message": { "type": "string", "example": "Berhasil mengambil detail kelas" }, "success": { "type": "boolean", "example": true } } }, "model.LoginData": { "type": "object", "properties": { "token": { "type": "string", "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoxLCJlbWFpbCI6ImFobWFkLmd1cnVAc2Vrb2xhaC5jb20iLCJyb2xlIjoiZ3VydSIsImV4cCI6MTcyMTE0MzQwMH0.xxxx" }, "user": { "$ref": "#/definitions/model.User" } } }, "model.LoginSuccessResponse": { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.LoginData" }, "message": { "type": "string", "example": "Login berhasil" }, "success": { "type": "boolean", "example": true } } }, "model.Mapel": { "type": "object", "properties": { "created_at": { "type": "string", "example": "2026-07-15T19:00:00Z" }, "id": { "type": "integer", "example": 1 }, "is_umum": { "type": "boolean", "example": true }, "jam": { "type": "integer", "example": 4 }, "jurusan": { "type": "string", "example": "Umum" }, "kode_mapel": { "type": "string", "example": "MP001" }, "nama_mapel": { "type": "string", "example": "Matematika" }, "updated_at": { "type": "string", "example": "2026-07-15T19:00:00Z" } } }, "model.MapelResponseList": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.Mapel" } }, "message": { "type": "string", "example": "Berhasil mengambil data mata pelajaran" }, "success": { "type": "boolean", "example": true } } }, "model.MapelResponseSingle": { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Mapel" }, "message": { "type": "string", "example": "Berhasil mengambil detail mata pelajaran" }, "success": { "type": "boolean", "example": true } } }, "model.Nilai": { "type": "object", "properties": { "created_at": { "type": "string", "example": "2026-07-15T19:00:00Z" }, "grade_huruf": { "type": "string", "example": "A" }, "guru": { "$ref": "#/definitions/model.Guru" }, "guru_id": { "type": "integer", "example": 1 }, "id": { "type": "integer", "example": 1 }, "kelas": { "$ref": "#/definitions/model.Kelas" }, "kelas_id": { "type": "integer", "example": 1 }, "mapel": { "$ref": "#/definitions/model.Mapel" }, "mapel_id": { "type": "integer", "example": 1 }, "nilai_akhir": { "type": "number", "example": 85.5 }, "semester": { "type": "string", "example": "Ganjil" }, "siswa": { "$ref": "#/definitions/model.Siswa" }, "siswa_id": { "type": "integer", "example": 1 }, "tahun_ajaran": { "type": "string", "example": "2026/2027" }, "tugas": { "type": "number", "example": 80 }, "uas": { "type": "number", "example": 90 }, "updated_at": { "type": "string", "example": "2026-07-15T19:00:00Z" }, "uts": { "type": "number", "example": 85 } } }, "model.NilaiResponseList": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.Nilai" } }, "message": { "type": "string", "example": "Berhasil mengambil data nilai siswa" }, "success": { "type": "boolean", "example": true } } }, "model.NilaiResponseSingle": { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Nilai" }, "message": { "type": "string", "example": "Berhasil mengambil detail nilai siswa" }, "success": { "type": "boolean", "example": true } } }, "model.Perizinan": { "type": "object", "properties": { "alasan": { "type": "string", "example": "Ada keperluan keluarga" }, "attachment_url": { "type": "string", "example": "/uploads/perizinan/sample.pdf" }, "created_at": { "type": "string", "example": "2026-07-15T19:00:00Z" }, "disetujui_oleh": { "type": "integer", "example": 1 }, "guru": { "$ref": "#/definitions/model.Guru" }, "id": { "type": "integer", "example": 1 }, "keterangan_guru": { "type": "string", "example": "Semoga lekas sembuh/urusan lancar" }, "siswa": { "$ref": "#/definitions/model.Siswa" }, "siswa_id": { "type": "integer", "example": 1 }, "status": { "description": "\"Pending\", \"Disetujui\", \"Ditolak\"", "type": "string", "example": "Pending" }, "tanggal_mulai": { "type": "string", "example": "2026-07-15T00:00:00Z" }, "tanggal_selesai": { "type": "string", "example": "2026-07-16T00:00:00Z" }, "tipe": { "description": "\"Izin\" atau \"Sakit\"", "type": "string", "example": "Izin" }, "updated_at": { "type": "string", "example": "2026-07-15T19:00:00Z" } } }, "model.PerizinanResponseList": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.Perizinan" } }, "message": { "type": "string", "example": "Berhasil mengambil data perizinan" }, "success": { "type": "boolean", "example": true } } }, "model.PerizinanResponseSingle": { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Perizinan" }, "message": { "type": "string", "example": "Berhasil mengambil detail perizinan" }, "success": { "type": "boolean", "example": true } } }, "model.RegisterSuccessResponse": { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.User" }, "message": { "type": "string", "example": "Register berhasil" }, "success": { "type": "boolean", "example": true } } }, "model.SchoolProfile": { "type": "object", "properties": { "academic_status": { "type": "string", "example": "🟢 Aktif" }, "academic_year": { "type": "string", "example": "2026/2027" }, "accreditation": { "type": "string", "example": "A (Sangat Baik)" }, "address": { "type": "string", "example": "Jl. Diponegoro No. 25, Salatiga" }, "appointment_period": { "type": "string", "example": "2021 - 2027" }, "created_at": { "type": "string", "example": "2026-07-15T19:00:00Z" }, "current_semester": { "type": "string", "example": "Ganjil" }, "curriculum": { "type": "string", "example": "Kurikulum Merdeka" }, "email": { "type": "string", "example": "info@smkn1salatiga.sch.id" }, "established_year": { "type": "string", "example": "1965" }, "facilities": { "type": "string", "example": "Perpustakaan, Lab Komputer, Bengkel Kerja, Lapangan Olahraga" }, "id": { "type": "integer", "example": 1 }, "level": { "type": "string", "example": "SMK / Sekolah Menengah Kejuruan" }, "logo": { "type": "string", "example": "/uploads/profile/logo.png" }, "mission": { "type": "string", "example": "1. Menyelenggarakan pembelajaran berkualitas...\n2. Membina budi pekerti luhur..." }, "name": { "type": "string", "example": "SMK Negeri 1 Salatiga" }, "npsn": { "type": "string", "example": "20312345" }, "operational_status": { "type": "string", "example": "Aktif" }, "phone": { "type": "string", "example": "(0298) 123456" }, "postal_code": { "type": "string", "example": "50711" }, "principal_name": { "type": "string", "example": "Drs. Hadi Santoso" }, "principal_nip": { "type": "string", "example": "197205121998031002" }, "principal_position": { "type": "string", "example": "Kepala Sekolah" }, "school_type": { "type": "string", "example": "Sekolah Menengah Kejuruan (SMK)" }, "shift": { "type": "string", "example": "Pagi" }, "status": { "type": "string", "example": "Negeri" }, "updated_at": { "type": "string", "example": "2026-07-15T19:00:00Z" }, "vision": { "type": "string", "example": "Menjadi lembaga pendidikan kejuruan yang unggul, berkarakter, dan berdaya saing global." }, "website": { "type": "string", "example": "https://smkn1salatiga.sch.id" } } }, "model.SchoolResponseSingle": { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.SchoolProfile" }, "message": { "type": "string", "example": "Berhasil mengambil profil sekolah" }, "success": { "type": "boolean", "example": true } } }, "model.Siswa": { "type": "object", "properties": { "alamat": { "type": "string", "example": "Jl. Diponegoro No. 25" }, "alamat_detail": { "type": "string", "example": "Jl. Diponegoro No. 25" }, "created_at": { "type": "string", "example": "2026-07-15T19:00:00Z" }, "desa": { "type": "string", "example": "Sidorejo Lor" }, "email": { "type": "string", "example": "budi.santoso@sekolah.com" }, "id": { "type": "integer", "example": 1 }, "jenis_kelamin": { "type": "string", "example": "Laki-laki" }, "kabupaten": { "type": "string", "example": "Salatiga" }, "kecamatan": { "type": "string", "example": "Sidorejo" }, "kelas": { "$ref": "#/definitions/model.Kelas" }, "kelas_id": { "type": "integer", "example": 1 }, "nama": { "type": "string", "example": "Budi Santoso" }, "nis": { "type": "string", "example": "12345678" }, "no_hp": { "type": "string", "example": "081234567890" }, "photo_url": { "type": "string", "example": "/uploads/profile/siswa_1.jpg" }, "provinsi": { "description": "Address Normalization Fields", "type": "string", "example": "Jawa Tengah" }, "tanggal_lahir": { "type": "string", "example": "2010-05-15" }, "tempat_lahir": { "description": "Deprecated Database Columns (Retained for Non-Destructive Migrations)", "type": "string", "example": "Salatiga" }, "updated_at": { "type": "string", "example": "2026-07-15T19:00:00Z" }, "user_id": { "type": "integer", "example": 2 } } }, "model.SiswaResponseCreated": { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Siswa" }, "message": { "type": "string", "example": "Siswa berhasil ditambahkan" }, "success": { "type": "boolean", "example": true }, "temporary_password": { "type": "string", "example": "Siswa123!" } } }, "model.SiswaResponseList": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.Siswa" } }, "message": { "type": "string", "example": "Berhasil mengambil data siswa" }, "success": { "type": "boolean", "example": true } } }, "model.SiswaResponseSingle": { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Siswa" }, "message": { "type": "string", "example": "Berhasil mengambil detail siswa" }, "success": { "type": "boolean", "example": true } } }, "model.User": { "type": "object", "properties": { "alamat": { "type": "string", "example": "Jl. Diponegoro No. 25, Salatiga" }, "created_at": { "type": "string", "example": "2026-07-15T19:00:00Z" }, "email": { "type": "string", "example": "ahmad.guru@sekolah.com" }, "gelar": { "type": "string", "example": "S.Pd." }, "id": { "type": "integer", "example": 1 }, "is_active": { "type": "boolean", "example": true }, "is_first_login": { "type": "boolean", "example": true }, "jenis_kelamin": { "type": "string", "example": "Laki-laki" }, "last_login_at": { "type": "string" }, "nama": { "type": "string", "example": "Ahmad Guru" }, "nip": { "description": "Ignored by GORM, populated for unified API login response", "type": "string", "example": "GR001" }, "nis": { "type": "string", "example": "12345678" }, "no_hp": { "type": "string", "example": "081234567890" }, "role": { "type": "string", "example": "guru" }, "updated_at": { "type": "string", "example": "2026-07-15T19:00:00Z" } } }, "service.ChangePasswordInput": { "type": "object", "properties": { "new_password": { "type": "string", "example": "GuruNew123!" }, "old_password": { "type": "string", "example": "Guru123!" } } }, "service.LoginInput": { "type": "object", "properties": { "email": { "type": "string", "example": "admin@sekolah.com" }, "identifier": { "type": "string", "example": "ADM001" }, "password": { "type": "string", "example": "Admin123!" } } }, "service.RegisterInput": { "type": "object", "properties": { "email": { "type": "string", "example": "ahmad.guru@sekolah.com" }, "nama": { "type": "string", "example": "Ahmad Guru" }, "password": { "type": "string", "example": "Guru123!" }, "role": { "type": "string", "example": "guru" } } } }, "securityDefinitions": { "BearerAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } } }