Last active
December 6, 2022 13:10
-
-
Save alg/ccd508e2a0e762d486d6cee00c0f3ad1 to your computer and use it in GitHub Desktop.
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": { | |
"title": "HR API", | |
"version": "3.0.0", | |
"description": "Manages employees, their roles and profiles.", | |
"contact": { | |
"name": "Aleksey Gureiev", | |
"email": "[email protected]" | |
} | |
}, | |
"paths": { | |
"\/api\/categories": { | |
"get": { | |
"tags": [ | |
"Categories" | |
], | |
"security": [], | |
"parameters": [ | |
{ | |
"name": "x-employee-id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "header" | |
} | |
], | |
"responses": { | |
"401": { | |
"content": {}, | |
"status": 200, | |
"description": "Unauthorized" | |
}, | |
"200": { | |
"content": { | |
"application\/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"data": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"properties": { | |
"id": { | |
"type": "integer", | |
"format": "int32", | |
"required": true, | |
"example": "1" | |
}, | |
"name": { | |
"type": "string", | |
"required": true, | |
"example": "Full-time" | |
}, | |
"instruction": { | |
"type": "string", | |
"example": "Category instruction template" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"status": 200, | |
"description": "Success" | |
} | |
}, | |
"summary": "Returns the list of all categories in the app." | |
}, | |
"post": { | |
"tags": [ | |
"Categories" | |
], | |
"security": [], | |
"parameters": [ | |
{ | |
"name": "x-employee-id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "header" | |
} | |
], | |
"responses": { | |
"403": { | |
"content": {}, | |
"status": 200, | |
"description": "Forbidden" | |
}, | |
"401": { | |
"content": {}, | |
"status": 200, | |
"description": "Unauthorized" | |
}, | |
"400": { | |
"content": { | |
"application\/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"errors": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"properties": { | |
"location": { | |
"type": "array", | |
"items": { | |
"type": "string", | |
"required": true | |
}, | |
"example": [ | |
"body", | |
"name" | |
] | |
}, | |
"messages": { | |
"type": "array", | |
"items": { | |
"type": "string", | |
"required": true | |
}, | |
"required": true, | |
"example": [ | |
"Can't be null" | |
] | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"status": 200, | |
"description": "Validation errors" | |
}, | |
"201": { | |
"content": {}, | |
"status": 200, | |
"description": "Category created" | |
} | |
}, | |
"requestBody": { | |
"content": { | |
"application\/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"name": { | |
"type": "string", | |
"required": true, | |
"example": "Name" | |
}, | |
"instruction": { | |
"type": "string", | |
"example": "Instruction" | |
} | |
} | |
} | |
} | |
}, | |
"required": true, | |
"description": null | |
}, | |
"summary": "Creates category." | |
} | |
}, | |
"\/api\/departments": { | |
"get": { | |
"tags": [ | |
"Departments" | |
], | |
"security": [], | |
"parameters": [ | |
{ | |
"name": "x-employee-id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "header" | |
} | |
], | |
"responses": { | |
"200": { | |
"content": { | |
"application\/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"data": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"properties": { | |
"id": { | |
"type": "string", | |
"required": true, | |
"description": "Department ID" | |
}, | |
"name": { | |
"type": "string", | |
"required": true, | |
"description": "User-facing department name" | |
}, | |
"description": { | |
"type": "string", | |
"required": true, | |
"description": "Description of the department" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"status": 200, | |
"description": "Departments list" | |
} | |
}, | |
"summary": "Returns the list of all departments in the application." | |
} | |
}, | |
"\/api\/employees\/me": { | |
"get": { | |
"tags": [ | |
"Employees" | |
], | |
"security": [], | |
"parameters": [ | |
{ | |
"name": "x-employee-id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "header" | |
} | |
], | |
"responses": { | |
"404": { | |
"content": {}, | |
"status": 200, | |
"description": "Employee not found" | |
}, | |
"401": { | |
"content": {}, | |
"status": 200, | |
"description": "Unauthorized" | |
}, | |
"200": { | |
"content": { | |
"application\/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"data": { | |
"type": "object", | |
"properties": { | |
"id": { | |
"type": "string", | |
"required": true, | |
"format": "uuid" | |
}, | |
"name": { | |
"type": "string", | |
"required": true, | |
"example": "Vasya" | |
}, | |
"email": { | |
"type": "string", | |
"format": "email", | |
"required": true | |
}, | |
"dateOfBirth": { | |
"type": "string", | |
"format": "date", | |
"required": true, | |
"example": "2011-01-24" | |
}, | |
"remote": { | |
"type": "boolean", | |
"required": true | |
}, | |
"department": { | |
"type": "string", | |
"required": true, | |
"example": "Backend" | |
}, | |
"categoryId": { | |
"type": "integer", | |
"format": "int32", | |
"required": true, | |
"example": 1 | |
}, | |
"skype": { | |
"type": "string", | |
"required": true, | |
"example": "skype" | |
}, | |
"phone": { | |
"type": "string", | |
"required": true, | |
"example": "79780001234" | |
}, | |
"workStartDate": { | |
"type": "string", | |
"format": "date", | |
"required": true | |
}, | |
"registrationType": { | |
"type": "string", | |
"required": true, | |
"oneOf": [ | |
"none", | |
"employee", | |
"entrepreneur", | |
"self-employed" | |
], | |
"example": "employee" | |
}, | |
"serviceAccounts": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
}, | |
"oneOf": [ | |
"jira", | |
"hubstaff", | |
"google_drive", | |
"sinel", | |
"yandex_mail" | |
], | |
"example": [ | |
"jira", | |
"hubstaff" | |
], | |
"required": true | |
}, | |
"office": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "main" | |
}, | |
"telegram": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "tele" | |
}, | |
"about": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "About me" | |
}, | |
"photo": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "photos\/key.png" | |
}, | |
"githubName": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "github" | |
}, | |
"gitlabName": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "gitlab" | |
}, | |
"roles": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
}, | |
"example": [ | |
"hr" | |
] | |
}, | |
"createdAt": { | |
"type": "string", | |
"format": "date-time", | |
"required": true | |
}, | |
"updatedAt": { | |
"type": "string", | |
"format": "date-time", | |
"required": true | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"status": 200, | |
"description": "Success" | |
} | |
}, | |
"summary": "Returns own profile." | |
} | |
}, | |
"\/api\/employees\/joined_this_month": { | |
"get": { | |
"tags": [ | |
"Employees" | |
], | |
"security": [], | |
"parameters": [ | |
{ | |
"name": "x-employee-id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "header" | |
} | |
], | |
"responses": { | |
"401": { | |
"content": {}, | |
"status": 200, | |
"description": "Unauthorized" | |
}, | |
"200": { | |
"content": { | |
"application\/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"data": { | |
"type": "object", | |
"properties": { | |
"id": { | |
"type": "string", | |
"required": true, | |
"format": "uuid" | |
}, | |
"name": { | |
"type": "string", | |
"required": true, | |
"example": "Vasya" | |
}, | |
"email": { | |
"type": "string", | |
"format": "email", | |
"required": true | |
}, | |
"dateOfBirth": { | |
"type": "string", | |
"format": "date", | |
"required": true, | |
"example": "2011-01-24" | |
}, | |
"remote": { | |
"type": "boolean", | |
"required": true | |
}, | |
"department": { | |
"type": "string", | |
"required": true, | |
"example": "Backend" | |
}, | |
"categoryId": { | |
"type": "integer", | |
"format": "int32", | |
"required": true, | |
"example": 1 | |
}, | |
"skype": { | |
"type": "string", | |
"required": true, | |
"example": "skype" | |
}, | |
"phone": { | |
"type": "string", | |
"required": true, | |
"example": "79780001234" | |
}, | |
"workStartDate": { | |
"type": "string", | |
"format": "date", | |
"required": true | |
}, | |
"registrationType": { | |
"type": "string", | |
"required": true, | |
"oneOf": [ | |
"none", | |
"employee", | |
"entrepreneur", | |
"self-employed" | |
], | |
"example": "employee" | |
}, | |
"serviceAccounts": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
}, | |
"oneOf": [ | |
"jira", | |
"hubstaff", | |
"google_drive", | |
"sinel", | |
"yandex_mail" | |
], | |
"example": [ | |
"jira", | |
"hubstaff" | |
], | |
"required": true | |
}, | |
"office": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "main" | |
}, | |
"telegram": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "tele" | |
}, | |
"about": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "About me" | |
}, | |
"photo": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "photos\/key.png" | |
}, | |
"githubName": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "github" | |
}, | |
"gitlabName": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "gitlab" | |
}, | |
"roles": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
}, | |
"example": [ | |
"hr" | |
] | |
}, | |
"createdAt": { | |
"type": "string", | |
"format": "date-time", | |
"required": true | |
}, | |
"updatedAt": { | |
"type": "string", | |
"format": "date-time", | |
"required": true | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"status": 200, | |
"description": "Success" | |
} | |
}, | |
"summary": "Returns the list of employees joined this month (looking by work_start_date field)." | |
} | |
}, | |
"\/api\/employees": { | |
"get": { | |
"tags": [ | |
"Employees" | |
], | |
"security": [], | |
"parameters": [ | |
{ | |
"name": "x-employee-id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "header" | |
}, | |
{ | |
"name": "page[after]", | |
"schema": { | |
"type": "string", | |
"description": "Page cursor" | |
}, | |
"description": "Page cursor. If unset, the first page.", | |
"in": "query" | |
}, | |
{ | |
"name": "page[size]", | |
"schema": { | |
"type": "integer", | |
"format": "int32", | |
"default": 50, | |
"description": "Page size" | |
}, | |
"description": "Page size", | |
"in": "query" | |
}, | |
{ | |
"name": "sort[order]", | |
"schema": { | |
"type": "string", | |
"description": "Sort order", | |
"enum": [ | |
"asc", | |
"desc" | |
], | |
"default": "asc" | |
}, | |
"description": "Order of sort", | |
"in": "query" | |
}, | |
{ | |
"name": "sort[field]", | |
"schema": { | |
"type": "string", | |
"description": "Field to sort results by", | |
"enum": [ | |
"name", | |
"workStartDate" | |
], | |
"default": "name" | |
}, | |
"description": "Field to sort results by", | |
"in": "query" | |
}, | |
{ | |
"name": "query", | |
"schema": { | |
"type": "string" | |
}, | |
"description": "Search query. Supports partial. Looks in the names.", | |
"in": "query" | |
}, | |
{ | |
"name": "department", | |
"schema": { | |
"type": "string" | |
}, | |
"description": "One or more departments an employee is in (comma-separated). Example: design,mobile", | |
"in": "query" | |
}, | |
{ | |
"name": "office", | |
"schema": { | |
"type": "string" | |
}, | |
"description": "One or more offices an employee works from (comma-separated). Example: \u0426\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0439,\u041b\u0438\u0434\u0435\u0440", | |
"in": "query" | |
} | |
], | |
"responses": { | |
"401": { | |
"content": {}, | |
"status": 200, | |
"description": "Unauthorized" | |
}, | |
"200": { | |
"content": { | |
"application\/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"data": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"properties": { | |
"id": { | |
"type": "string", | |
"required": true, | |
"format": "uuid" | |
}, | |
"name": { | |
"type": "string", | |
"required": true, | |
"example": "Vasya" | |
}, | |
"email": { | |
"type": "string", | |
"format": "email", | |
"required": true | |
}, | |
"dateOfBirth": { | |
"type": "string", | |
"format": "date", | |
"required": true, | |
"example": "2011-01-24" | |
}, | |
"remote": { | |
"type": "boolean", | |
"required": true | |
}, | |
"department": { | |
"type": "string", | |
"required": true, | |
"example": "Backend" | |
}, | |
"categoryId": { | |
"type": "integer", | |
"format": "int32", | |
"required": true, | |
"example": 1 | |
}, | |
"skype": { | |
"type": "string", | |
"required": true, | |
"example": "skype" | |
}, | |
"phone": { | |
"type": "string", | |
"required": true, | |
"example": "79780001234" | |
}, | |
"workStartDate": { | |
"type": "string", | |
"format": "date", | |
"required": true | |
}, | |
"registrationType": { | |
"type": "string", | |
"required": true, | |
"oneOf": [ | |
"none", | |
"employee", | |
"entrepreneur", | |
"self-employed" | |
], | |
"example": "employee" | |
}, | |
"serviceAccounts": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
}, | |
"oneOf": [ | |
"jira", | |
"hubstaff", | |
"google_drive", | |
"sinel", | |
"yandex_mail" | |
], | |
"example": [ | |
"jira", | |
"hubstaff" | |
], | |
"required": true | |
}, | |
"office": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "main" | |
}, | |
"telegram": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "tele" | |
}, | |
"about": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "About me" | |
}, | |
"photo": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "photos\/key.png" | |
}, | |
"githubName": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "github" | |
}, | |
"gitlabName": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "gitlab" | |
}, | |
"roles": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
}, | |
"example": [ | |
"hr" | |
] | |
}, | |
"createdAt": { | |
"type": "string", | |
"format": "date-time", | |
"required": true | |
}, | |
"updatedAt": { | |
"type": "string", | |
"format": "date-time", | |
"required": true | |
} | |
} | |
} | |
}, | |
"page": { | |
"type": "object", | |
"properties": { | |
"cursor": { | |
"type": "string", | |
"nullable": true, | |
"example": "1eb2dafc3", | |
"description": "Next page cursor. If missing, no next page." | |
}, | |
"total": { | |
"type": "integer", | |
"format": "int32", | |
"required": true, | |
"example": 1, | |
"description": "Total number of records in the set." | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"status": 200, | |
"description": "Success" | |
} | |
}, | |
"summary": "Returns the list of all employees." | |
}, | |
"post": { | |
"tags": [ | |
"Employees" | |
], | |
"security": [], | |
"parameters": [ | |
{ | |
"name": "x-employee-id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "header" | |
} | |
], | |
"responses": { | |
"409": { | |
"content": {}, | |
"status": 200, | |
"description": "Employee email taken" | |
}, | |
"403": { | |
"content": {}, | |
"status": 200, | |
"description": "Forbidden" | |
}, | |
"401": { | |
"content": {}, | |
"status": 200, | |
"description": "Unauthorized" | |
}, | |
"400": { | |
"content": { | |
"application\/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"errors": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"properties": { | |
"location": { | |
"type": "array", | |
"items": { | |
"type": "string", | |
"required": true | |
}, | |
"example": [ | |
"body", | |
"name" | |
] | |
}, | |
"messages": { | |
"type": "array", | |
"items": { | |
"type": "string", | |
"required": true | |
}, | |
"required": true, | |
"example": [ | |
"Can't be null" | |
] | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"status": 200, | |
"description": "Validation errors" | |
}, | |
"201": { | |
"content": {}, | |
"status": 200, | |
"description": "Employee created" | |
} | |
}, | |
"requestBody": { | |
"content": { | |
"application\/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"password": { | |
"type": "string", | |
"required": true | |
}, | |
"name": { | |
"type": "string", | |
"required": true, | |
"example": "Vasya" | |
}, | |
"email": { | |
"type": "string", | |
"format": "email", | |
"required": true | |
}, | |
"dateOfBirth": { | |
"type": "string", | |
"format": "date", | |
"required": true, | |
"example": "2011-01-24" | |
}, | |
"remote": { | |
"type": "boolean", | |
"required": true | |
}, | |
"department": { | |
"type": "string", | |
"required": true, | |
"example": "Backend" | |
}, | |
"categoryId": { | |
"type": "integer", | |
"format": "int32", | |
"required": true, | |
"example": 1 | |
}, | |
"skype": { | |
"type": "string", | |
"required": true, | |
"example": "skype" | |
}, | |
"phone": { | |
"type": "string", | |
"required": true, | |
"example": "79780001234" | |
}, | |
"workStartSate": { | |
"type": "string", | |
"format": "date", | |
"required": true | |
}, | |
"registrationType": { | |
"type": "string", | |
"required": true, | |
"oneOf": [ | |
"none", | |
"employee", | |
"entrepreneur", | |
"self-employed" | |
], | |
"example": "employee" | |
}, | |
"serviceAccounts": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
}, | |
"oneOf": [ | |
"jira", | |
"hubstaff", | |
"google_drive", | |
"sinel", | |
"yandex_mail" | |
], | |
"example": [ | |
"jira", | |
"hubstaff" | |
], | |
"required": true | |
}, | |
"office": { | |
"type": "string", | |
"nullable": true, | |
"example": "main" | |
}, | |
"telegram": { | |
"type": "string", | |
"nullable": true, | |
"example": "tele" | |
}, | |
"about": { | |
"type": "string", | |
"nullable": true, | |
"example": "About me" | |
}, | |
"photo": { | |
"type": "string", | |
"nullable": true, | |
"example": "photos\/key.png" | |
}, | |
"githubName": { | |
"type": "string", | |
"nullable": true, | |
"example": "github" | |
}, | |
"gitlabName": { | |
"type": "string", | |
"nullable": true, | |
"example": "gitlab" | |
}, | |
"roles": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
}, | |
"example": [ | |
"hr" | |
] | |
} | |
} | |
} | |
} | |
}, | |
"required": true, | |
"description": null | |
}, | |
"summary": "Registers the employee." | |
} | |
}, | |
"\/api\/employees\/upcoming_birthdays": { | |
"get": { | |
"tags": [ | |
"Employees" | |
], | |
"security": [], | |
"parameters": [ | |
{ | |
"name": "x-employee-id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "header" | |
} | |
], | |
"responses": { | |
"401": { | |
"content": {}, | |
"status": 200, | |
"description": "Unauthorized" | |
}, | |
"200": { | |
"content": { | |
"application\/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"data": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"properties": { | |
"id": { | |
"type": "string", | |
"required": true, | |
"format": "uuid" | |
}, | |
"name": { | |
"type": "string", | |
"required": true, | |
"example": "Vasya" | |
}, | |
"email": { | |
"type": "string", | |
"format": "email", | |
"required": true | |
}, | |
"dateOfBirth": { | |
"type": "string", | |
"format": "date", | |
"required": true, | |
"example": "2011-01-24" | |
}, | |
"remote": { | |
"type": "boolean", | |
"required": true | |
}, | |
"department": { | |
"type": "string", | |
"required": true, | |
"example": "Backend" | |
}, | |
"categoryId": { | |
"type": "integer", | |
"format": "int32", | |
"required": true, | |
"example": 1 | |
}, | |
"skype": { | |
"type": "string", | |
"required": true, | |
"example": "skype" | |
}, | |
"phone": { | |
"type": "string", | |
"required": true, | |
"example": "79780001234" | |
}, | |
"workStartDate": { | |
"type": "string", | |
"format": "date", | |
"required": true | |
}, | |
"registrationType": { | |
"type": "string", | |
"required": true, | |
"oneOf": [ | |
"none", | |
"employee", | |
"entrepreneur", | |
"self-employed" | |
], | |
"example": "employee" | |
}, | |
"serviceAccounts": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
}, | |
"oneOf": [ | |
"jira", | |
"hubstaff", | |
"google_drive", | |
"sinel", | |
"yandex_mail" | |
], | |
"example": [ | |
"jira", | |
"hubstaff" | |
], | |
"required": true | |
}, | |
"office": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "main" | |
}, | |
"telegram": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "tele" | |
}, | |
"about": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "About me" | |
}, | |
"photo": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "photos\/key.png" | |
}, | |
"githubName": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "github" | |
}, | |
"gitlabName": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "gitlab" | |
}, | |
"roles": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
}, | |
"example": [ | |
"hr" | |
] | |
}, | |
"createdAt": { | |
"type": "string", | |
"format": "date-time", | |
"required": true | |
}, | |
"updatedAt": { | |
"type": "string", | |
"format": "date-time", | |
"required": true | |
} | |
} | |
} | |
}, | |
"page": { | |
"type": "object", | |
"properties": { | |
"cursor": { | |
"type": "string", | |
"nullable": true, | |
"example": "1eb2dafc3", | |
"description": "Next page cursor. If missing, no next page." | |
}, | |
"total": { | |
"type": "integer", | |
"format": "int32", | |
"required": true, | |
"example": 1, | |
"description": "Total number of records in the set." | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"status": 200, | |
"description": "Success" | |
} | |
}, | |
"summary": "Returns the list of employees with upcoming birthdays." | |
} | |
}, | |
"\/api\/offices": { | |
"get": { | |
"tags": [ | |
"Offices" | |
], | |
"security": [], | |
"parameters": [ | |
{ | |
"name": "x-employee-id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "header" | |
} | |
], | |
"responses": { | |
"200": { | |
"content": { | |
"application\/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"data": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"properties": { | |
"id": { | |
"type": "string", | |
"required": true, | |
"description": "Office ID" | |
}, | |
"name": { | |
"type": "string", | |
"required": true, | |
"description": "User-facing office name" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"status": 200, | |
"description": "Offices list" | |
} | |
}, | |
"summary": "Returns the list of all offices in the application." | |
} | |
}, | |
"\/api\/roles": { | |
"get": { | |
"tags": [ | |
"Roles" | |
], | |
"security": [], | |
"parameters": [ | |
{ | |
"name": "x-employee-id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "header" | |
} | |
], | |
"responses": { | |
"200": { | |
"content": { | |
"application\/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"data": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"properties": { | |
"id": { | |
"type": "string", | |
"required": true, | |
"description": "Role ID" | |
}, | |
"name": { | |
"type": "string", | |
"required": true, | |
"description": "User-facing role name" | |
}, | |
"description": { | |
"type": "string", | |
"required": true, | |
"description": "Description of the role" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"status": 200, | |
"description": "Roles list" | |
} | |
}, | |
"summary": "Returns the list of all roles in the application." | |
} | |
}, | |
"\/api\/service_accounts": { | |
"get": { | |
"tags": [ | |
"Service Accounts" | |
], | |
"security": [], | |
"parameters": [ | |
{ | |
"name": "x-employee-id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "header" | |
} | |
], | |
"responses": { | |
"200": { | |
"content": { | |
"application\/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"data": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"properties": { | |
"id": { | |
"type": "string", | |
"required": true, | |
"description": "ServiceAccount ID" | |
}, | |
"name": { | |
"type": "string", | |
"required": true, | |
"description": "User-facing service account name" | |
}, | |
"description": { | |
"type": "string", | |
"description": "Service description" | |
}, | |
"url": { | |
"type": "string", | |
"description": "Service URL", | |
"format": "url" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"status": 200, | |
"description": "Service accounts list" | |
} | |
}, | |
"summary": "Returns the list of all service accounts in the application." | |
} | |
}, | |
"\/api\/categories\/{category_id}": { | |
"get": { | |
"tags": [ | |
"Categories" | |
], | |
"security": [], | |
"parameters": [ | |
{ | |
"name": "x-employee-id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "header" | |
}, | |
{ | |
"name": "category_id", | |
"schema": { | |
"type": "integer", | |
"format": "int32" | |
}, | |
"required": true, | |
"in": "path" | |
} | |
], | |
"responses": { | |
"404": { | |
"content": {}, | |
"status": 200, | |
"description": "Category not found" | |
}, | |
"401": { | |
"content": {}, | |
"status": 200, | |
"description": "Unauthorized" | |
}, | |
"200": { | |
"content": { | |
"application\/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"data": { | |
"type": "object", | |
"properties": { | |
"id": { | |
"type": "integer", | |
"format": "int32", | |
"required": true, | |
"example": "1" | |
}, | |
"name": { | |
"type": "string", | |
"required": true, | |
"example": "Full-time" | |
}, | |
"instruction": { | |
"type": "string", | |
"example": "Category instruction template" | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"status": 200, | |
"description": "Success" | |
} | |
}, | |
"summary": "Returns the category." | |
}, | |
"delete": { | |
"tags": [ | |
"Categories" | |
], | |
"security": [], | |
"parameters": [ | |
{ | |
"name": "x-employee-id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "header" | |
}, | |
{ | |
"name": "category_id", | |
"schema": { | |
"type": "integer", | |
"format": "int32" | |
}, | |
"required": true, | |
"in": "path" | |
} | |
], | |
"responses": { | |
"404": { | |
"content": {}, | |
"status": 200, | |
"description": "Category not found" | |
}, | |
"403": { | |
"content": {}, | |
"status": 200, | |
"description": "Forbidden" | |
}, | |
"401": { | |
"content": {}, | |
"status": 200, | |
"description": "Unauthorized" | |
}, | |
"204": { | |
"content": {}, | |
"status": 200, | |
"description": "Category deleted" | |
} | |
}, | |
"summary": "Deletes category." | |
}, | |
"put": { | |
"tags": [ | |
"Categories" | |
], | |
"security": [], | |
"parameters": [ | |
{ | |
"name": "x-employee-id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "header" | |
}, | |
{ | |
"name": "category_id", | |
"schema": { | |
"type": "integer", | |
"format": "int32" | |
}, | |
"required": true, | |
"in": "path" | |
} | |
], | |
"responses": { | |
"404": { | |
"content": {}, | |
"status": 200, | |
"description": "Category not found" | |
}, | |
"403": { | |
"content": {}, | |
"status": 200, | |
"description": "Forbidden" | |
}, | |
"401": { | |
"content": {}, | |
"status": 200, | |
"description": "Unauthorized" | |
}, | |
"400": { | |
"content": { | |
"application\/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"errors": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"properties": { | |
"location": { | |
"type": "array", | |
"items": { | |
"type": "string", | |
"required": true | |
}, | |
"example": [ | |
"body", | |
"name" | |
] | |
}, | |
"messages": { | |
"type": "array", | |
"items": { | |
"type": "string", | |
"required": true | |
}, | |
"required": true, | |
"example": [ | |
"Can't be null" | |
] | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"status": 200, | |
"description": "Validation errors" | |
}, | |
"204": { | |
"content": {}, | |
"status": 200, | |
"description": "Category updated" | |
} | |
}, | |
"requestBody": { | |
"content": { | |
"application\/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"name": { | |
"type": "string", | |
"required": true, | |
"example": "New Name" | |
}, | |
"instruction": { | |
"type": "string", | |
"required": true, | |
"example": "New instruction" | |
} | |
} | |
} | |
} | |
}, | |
"required": true, | |
"description": null | |
}, | |
"summary": "Updates category." | |
} | |
}, | |
"\/api\/employees\/{employee_id}": { | |
"get": { | |
"tags": [ | |
"Employees" | |
], | |
"security": [], | |
"parameters": [ | |
{ | |
"name": "x-employee-id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "header" | |
}, | |
{ | |
"name": "employee_id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "path" | |
} | |
], | |
"responses": { | |
"404": { | |
"content": {}, | |
"status": 200, | |
"description": "Employee not found" | |
}, | |
"401": { | |
"content": {}, | |
"status": 200, | |
"description": "Unauthorized" | |
}, | |
"200": { | |
"content": { | |
"application\/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"data": { | |
"type": "object", | |
"properties": { | |
"id": { | |
"type": "string", | |
"required": true, | |
"format": "uuid" | |
}, | |
"name": { | |
"type": "string", | |
"required": true, | |
"example": "Vasya" | |
}, | |
"email": { | |
"type": "string", | |
"format": "email", | |
"required": true | |
}, | |
"dateOfBirth": { | |
"type": "string", | |
"format": "date", | |
"required": true, | |
"example": "2011-01-24" | |
}, | |
"remote": { | |
"type": "boolean", | |
"required": true | |
}, | |
"department": { | |
"type": "string", | |
"required": true, | |
"example": "Backend" | |
}, | |
"categoryId": { | |
"type": "integer", | |
"format": "int32", | |
"required": true, | |
"example": 1 | |
}, | |
"skype": { | |
"type": "string", | |
"required": true, | |
"example": "skype" | |
}, | |
"phone": { | |
"type": "string", | |
"required": true, | |
"example": "79780001234" | |
}, | |
"workStartDate": { | |
"type": "string", | |
"format": "date", | |
"required": true | |
}, | |
"registrationType": { | |
"type": "string", | |
"required": true, | |
"oneOf": [ | |
"none", | |
"employee", | |
"entrepreneur", | |
"self-employed" | |
], | |
"example": "employee" | |
}, | |
"serviceAccounts": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
}, | |
"oneOf": [ | |
"jira", | |
"hubstaff", | |
"google_drive", | |
"sinel", | |
"yandex_mail" | |
], | |
"example": [ | |
"jira", | |
"hubstaff" | |
], | |
"required": true | |
}, | |
"office": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "main" | |
}, | |
"telegram": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "tele" | |
}, | |
"about": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "About me" | |
}, | |
"photo": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "photos\/key.png" | |
}, | |
"githubName": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "github" | |
}, | |
"gitlabName": { | |
"type": "string", | |
"required": true, | |
"nullable": true, | |
"example": "gitlab" | |
}, | |
"roles": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
}, | |
"example": [ | |
"hr" | |
] | |
}, | |
"createdAt": { | |
"type": "string", | |
"format": "date-time", | |
"required": true | |
}, | |
"updatedAt": { | |
"type": "string", | |
"format": "date-time", | |
"required": true | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"status": 200, | |
"description": "Success" | |
} | |
}, | |
"summary": "Returns employee." | |
}, | |
"delete": { | |
"tags": [ | |
"Employees" | |
], | |
"security": [], | |
"parameters": [ | |
{ | |
"name": "x-employee-id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "header" | |
}, | |
{ | |
"name": "employee_id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "path" | |
} | |
], | |
"responses": { | |
"403": { | |
"content": {}, | |
"status": 200, | |
"description": "Forbidden" | |
}, | |
"401": { | |
"content": {}, | |
"status": 200, | |
"description": "Unauthorized" | |
}, | |
"204": { | |
"content": {}, | |
"status": 200, | |
"description": "Employee deleted" | |
} | |
}, | |
"summary": "Deletes the employee." | |
}, | |
"put": { | |
"tags": [ | |
"Employees" | |
], | |
"security": [], | |
"parameters": [ | |
{ | |
"name": "x-employee-id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "header" | |
}, | |
{ | |
"name": "employee_id", | |
"schema": { | |
"type": "string" | |
}, | |
"required": true, | |
"in": "path" | |
} | |
], | |
"responses": { | |
"409": { | |
"content": {}, | |
"status": 200, | |
"description": "Employee email taken" | |
}, | |
"403": { | |
"content": {}, | |
"status": 200, | |
"description": "Forbidden" | |
}, | |
"401": { | |
"content": {}, | |
"status": 200, | |
"description": "Unauthorized" | |
}, | |
"400": { | |
"content": {}, | |
"status": 200, | |
"description": "Validation errors" | |
}, | |
"204": { | |
"content": {}, | |
"status": 200, | |
"description": "Employee updated" | |
} | |
}, | |
"requestBody": { | |
"content": { | |
"application\/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"name": { | |
"type": "string", | |
"required": true, | |
"example": "Vasya" | |
}, | |
"email": { | |
"type": "string", | |
"format": "email", | |
"required": true | |
}, | |
"dateOfBirth": { | |
"type": "string", | |
"format": "date", | |
"required": true, | |
"example": "2011-01-24" | |
}, | |
"remote": { | |
"type": "boolean", | |
"required": true | |
}, | |
"department": { | |
"type": "string", | |
"required": true, | |
"example": "Backend" | |
}, | |
"categoryId": { | |
"type": "integer", | |
"format": "int32", | |
"required": true, | |
"example": 1 | |
}, | |
"skype": { | |
"type": "string", | |
"required": true, | |
"example": "skype" | |
}, | |
"phone": { | |
"type": "string", | |
"required": true, | |
"example": "79780001234" | |
}, | |
"workStartDate": { | |
"type": "string", | |
"format": "date", | |
"required": true | |
}, | |
"registrationType": { | |
"type": "string", | |
"required": true, | |
"oneOf": [ | |
"none", | |
"employee", | |
"entrepreneur", | |
"self-employed" | |
], | |
"example": "employee" | |
}, | |
"serviceAccounts": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
}, | |
"oneOf": [ | |
"jira", | |
"hubstaff", | |
"google_drive", | |
"sinel", | |
"yandex_mail" | |
], | |
"example": [ | |
"jira", | |
"hubstaff" | |
], | |
"required": true | |
}, | |
"office": { | |
"type": "string", | |
"nullable": true, | |
"example": "main" | |
}, | |
"telegram": { | |
"type": "string", | |
"nullable": true, | |
"example": "tele" | |
}, | |
"about": { | |
"type": "string", | |
"nullable": true, | |
"example": "About me" | |
}, | |
"photo": { | |
"type": "string", | |
"nullable": true, | |
"example": "photos\/key.png" | |
}, | |
"githubName": { | |
"type": "string", | |
"nullable": true, | |
"example": "github" | |
}, | |
"gitlabName": { | |
"type": "string", | |
"nullable": true, | |
"example": "gitlab" | |
}, | |
"roles": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
}, | |
"example": [ | |
"hr" | |
] | |
} | |
} | |
} | |
} | |
}, | |
"required": true, | |
"description": null | |
}, | |
"summary": "Updates the employee." | |
} | |
} | |
}, | |
"tags": [ | |
{ | |
"name": "Categories" | |
}, | |
{ | |
"name": "Departments" | |
}, | |
{ | |
"name": "Employees" | |
}, | |
{ | |
"name": "Offices" | |
}, | |
{ | |
"name": "Roles" | |
}, | |
{ | |
"name": "Service Accounts" | |
} | |
], | |
"servers": [], | |
"components": null, | |
"externalDocs": null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment