116 lines
3.3 KiB
JSON
116 lines
3.3 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "Rest API CRUD User",
|
|
"title": "Crud User",
|
|
"contact": {},
|
|
"version": "1"
|
|
},
|
|
"host": "localhost:8080",
|
|
"paths": {
|
|
"/api/user": {
|
|
"get": {
|
|
"description": "returs list of all users from the database",
|
|
"tags": [
|
|
"Users"
|
|
],
|
|
"summary": "return list of all",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.User"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/user/create": {
|
|
"post": {
|
|
"description": "Insert Data User",
|
|
"tags": [
|
|
"Users"
|
|
],
|
|
"summary": "Insert Data User",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/user/delete/:id": {
|
|
"delete": {
|
|
"description": "Delete Data User",
|
|
"tags": [
|
|
"Users"
|
|
],
|
|
"summary": "Delete Data User",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/user/update/:id": {
|
|
"put": {
|
|
"description": "Update Data User",
|
|
"tags": [
|
|
"Users"
|
|
],
|
|
"summary": "Update Data User",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"models.Response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"response_code": {
|
|
"type": "string"
|
|
},
|
|
"response_message": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.User": {
|
|
"type": "object",
|
|
"properties": {
|
|
"agama": {
|
|
"type": "string"
|
|
},
|
|
"alamat": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"jenis_kelamin": {
|
|
"type": "string"
|
|
},
|
|
"nama": {
|
|
"type": "string"
|
|
},
|
|
"umur": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |