Skip to content
Open

Hw1 #57

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
150 changes: 150 additions & 0 deletions openapi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
{
"openapi": "3.0.0",
"info": {
"title": "RecoService",
"version": "1.0.0"
},
"components": {
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
},
"schemas": {
"RecoResponse": {
"type": "object",
"properties": {
"user_id": {
"type": "integer"
},
"items": {
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"ErrorResponse": {
"type": "object",
"properties": {
"status_code": {
"type": "integer"
},
"error_key": {
"type": "string"
},
"error_message": {
"type": "string"
},
"error_loc": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
},
"security": [
{
"bearerAuth": []
}
],
"paths": {
"/health": {
"get": {
"tags": [
"Health"
],
"summary": "Health Check",
"security": [
{
"bearerAuth": []
}
],
"responses": {
"200": {
"description": "Server is operational"
},
"401": {
"description": "Unauthorized or invalid token",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
}
}
},
"/reco/{model_name}/{user_id}": {
"get": {
"tags": [
"Recommendations"
],
"summary": "Get Recommendations",
"parameters": [
{
"in": "path",
"name": "model_name",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "user_id",
"required": true,
"schema": {
"type": "integer"
}
}
],
"security": [
{
"bearerAuth": []
}
],
"responses": {
"200": {
"description": "Recommendations retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RecoResponse"
}
}
}
},
"401": {
"description": "Unauthorized or invalid token",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
},
"404": {
"description": "User or model not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
}
}
}
}
}
Loading