Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
704 changes: 25 additions & 679 deletions ewm-main-service-spec.json → API-event-service-specification.json

Large diffs are not rendered by default.

599 changes: 599 additions & 0 deletions API-request-service-specification.json

Large diffs are not rendered by default.

File renamed without changes.
387 changes: 387 additions & 0 deletions API-user-service-specification.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,387 @@
{
"openapi": "3.0.1",
"info": {
"description": "Documentation \"Explore With Me\" API v1.0",
"title": "Explore With Me- USER SERVICE API",
"version": "1.0"
},
"servers": [
{
"description": "Generated server url",
"url": "http://localhost:8080"
}
],
"tags": [
{
"description": "API для работы с пользователями",
"name": "Admin: Пользователи"
}
],
"paths": {
"/admin/users": {
"get": {
"description": "Возвращает информацию обо всех пользователях (учитываются параметры ограничения выборки), либо о конкретных (учитываются указанные идентификаторы)\n\nВ случае, если по заданным фильтрам не найдено ни одного пользователя, возвращает пустой список",
"operationId": "getUsers",
"parameters": [
{
"description": "id пользователей",
"in": "query",
"name": "ids",
"required": false,
"schema": {
"type": "array",
"items": {
"type": "integer",
"format": "int64"
}
}
},
{
"description": "количество элементов, которые нужно пропустить для формирования текущего набора",
"in": "query",
"name": "from",
"required": false,
"schema": {
"minimum": 0,
"type": "integer",
"format": "int32",
"default": 0
}
},
{
"description": "количество элементов в наборе",
"in": "query",
"name": "size",
"required": false,
"schema": {
"type": "integer",
"format": "int32",
"default": 10
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserDto"
}
}
}
},
"description": "Пользователи найдены"
},
"400": {
"content": {
"application/json": {
"example": {
"status": "BAD_REQUEST",
"reason": "Incorrectly made request.",
"message": "Failed to convert value of type java.lang.String to required type int; nested exception is java.lang.NumberFormatException: For input string: ad",
"timestamp": "2022-09-07 09:10:50"
},
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
},
"description": "Запрос составлен некорректно"
}
},
"summary": "Получение информации о пользователях",
"tags": [
"Admin: Пользователи"
]
},
"post": {
"operationId": "registerUser",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NewUserRequest"
}
}
},
"description": "Данные добавляемого пользователя",
"required": true
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserDto"
}
}
},
"description": "Пользователь зарегистрирован"
},
"400": {
"content": {
"application/json": {
"example": {
"status": "BAD_REQUEST",
"reason": "Incorrectly made request.",
"message": "Field: name. Error: must not be blank. Value: null",
"timestamp": "2022-09-07 09:10:50"
},
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
},
"description": "Запрос составлен некорректно"
},
"409": {
"content": {
"application/json": {
"example": {
"status": "CONFLICT",
"reason": "Integrity constraint has been violated.",
"message": "could not execute statement; SQL [n/a]; constraint [uq_email]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement",
"timestamp": "2022-09-07 09:10:50"
},
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
},
"description": "Нарушение целостности данных"
}
},
"summary": "Добавление нового пользователя",
"tags": [
"Admin: Пользователи"
]
}
},
"/admin/users/{userId}": {
"delete": {
"operationId": "delete",
"parameters": [
{
"description": "id пользователя",
"in": "path",
"name": "userId",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"responses": {
"204": {
"description": "Пользователь удален"
},
"404": {
"content": {
"application/json": {
"example": {
"status": "NOT_FOUND",
"reason": "The required object was not found.",
"message": "User with id=555 was not found",
"timestamp": "2022-09-07 09:10:50"
},
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
},
"description": "Пользователь не найден или недоступен"
}
},
"summary": "Удаление пользователя",
"tags": [
"Admin: Пользователи"
]
}
}
},
"components": {
"schemas": {
"ApiError": {
"type": "object",
"properties": {
"errors": {
"type": "array",
"description": "Список стектрейсов или описания ошибок",
"example": [],
"items": {
"type": "string",
"description": "Список стектрейсов или описания ошибок",
"example": "[]"
}
},
"message": {
"type": "string",
"description": "Сообщение об ошибке",
"example": "Only pending or canceled events can be changed"
},
"reason": {
"type": "string",
"description": "Общее описание причины ошибки",
"example": "For the requested operation the conditions are not met."
},
"status": {
"type": "string",
"description": "Код статуса HTTP-ответа",
"example": "FORBIDDEN",
"enum": [
"100 CONTINUE",
"101 SWITCHING_PROTOCOLS",
"102 PROCESSING",
"103 CHECKPOINT",
"200 OK",
"201 CREATED",
"202 ACCEPTED",
"203 NON_AUTHORITATIVE_INFORMATION",
"204 NO_CONTENT",
"205 RESET_CONTENT",
"206 PARTIAL_CONTENT",
"207 MULTI_STATUS",
"208 ALREADY_REPORTED",
"226 IM_USED",
"300 MULTIPLE_CHOICES",
"301 MOVED_PERMANENTLY",
"302 FOUND",
"302 MOVED_TEMPORARILY",
"303 SEE_OTHER",
"304 NOT_MODIFIED",
"305 USE_PROXY",
"307 TEMPORARY_REDIRECT",
"308 PERMANENT_REDIRECT",
"400 BAD_REQUEST",
"401 UNAUTHORIZED",
"402 PAYMENT_REQUIRED",
"403 FORBIDDEN",
"404 NOT_FOUND",
"405 METHOD_NOT_ALLOWED",
"406 NOT_ACCEPTABLE",
"407 PROXY_AUTHENTICATION_REQUIRED",
"408 REQUEST_TIMEOUT",
"409 CONFLICT",
"410 GONE",
"411 LENGTH_REQUIRED",
"412 PRECONDITION_FAILED",
"413 PAYLOAD_TOO_LARGE",
"413 REQUEST_ENTITY_TOO_LARGE",
"414 URI_TOO_LONG",
"414 REQUEST_URI_TOO_LONG",
"415 UNSUPPORTED_MEDIA_TYPE",
"416 REQUESTED_RANGE_NOT_SATISFIABLE",
"417 EXPECTATION_FAILED",
"418 I_AM_A_TEAPOT",
"419 INSUFFICIENT_SPACE_ON_RESOURCE",
"420 METHOD_FAILURE",
"421 DESTINATION_LOCKED",
"422 UNPROCESSABLE_ENTITY",
"423 LOCKED",
"424 FAILED_DEPENDENCY",
"425 TOO_EARLY",
"426 UPGRADE_REQUIRED",
"428 PRECONDITION_REQUIRED",
"429 TOO_MANY_REQUESTS",
"431 REQUEST_HEADER_FIELDS_TOO_LARGE",
"451 UNAVAILABLE_FOR_LEGAL_REASONS",
"500 INTERNAL_SERVER_ERROR",
"501 NOT_IMPLEMENTED",
"502 BAD_GATEWAY",
"503 SERVICE_UNAVAILABLE",
"504 GATEWAY_TIMEOUT",
"505 HTTP_VERSION_NOT_SUPPORTED",
"506 VARIANT_ALSO_NEGOTIATES",
"507 INSUFFICIENT_STORAGE",
"508 LOOP_DETECTED",
"509 BANDWIDTH_LIMIT_EXCEEDED",
"510 NOT_EXTENDED",
"511 NETWORK_AUTHENTICATION_REQUIRED"
]
},
"timestamp": {
"type": "string",
"description": "Дата и время когда произошла ошибка (в формате \"yyyy-MM-dd HH:mm:ss\")",
"example": "2022-06-09 06:27:23"
}
},
"description": "Сведения об ошибке"
},
"NewUserRequest": {
"required": [
"email",
"name"
],
"type": "object",
"properties": {
"email": {
"maxLength": 254,
"minLength": 6,
"type": "string",
"description": "Почтовый адрес",
"example": "ivan.petrov@practicummail.ru"
},
"name": {
"maxLength": 250,
"minLength": 2,
"type": "string",
"description": "Имя",
"example": "Иван Петров"
}
},
"description": "Данные нового пользователя"
},
"UserDto": {
"required": [
"email",
"name"
],
"type": "object",
"properties": {
"email": {
"type": "string",
"description": "Почтовый адрес",
"example": "petrov.i@practicummail.ru"
},
"id": {
"type": "integer",
"description": "Идентификатор",
"format": "int64",
"readOnly": true,
"example": 1
},
"name": {
"type": "string",
"description": "Имя",
"example": "Петров Иван"
}
},
"description": "Пользователь"
},
"UserShortDto": {
"required": [
"id",
"name"
],
"type": "object",
"properties": {
"id": {
"type": "integer",
"description": "Идентификатор",
"format": "int64",
"example": 3
},
"name": {
"type": "string",
"description": "Имя",
"example": "Фёдоров Матвей"
}
},
"description": "Пользователь (краткая информация)"
}
}
}
}
Loading