SurfSense/apps/docs/openapi.json

545 lines
14 KiB
JSON
Raw Normal View History

2024-07-30 16:00:11 -07:00
{
"openapi": "3.1.0",
"info": {
"title": "FastAPI App",
"description": "A simple FastAPI app",
"version": "0.1.0"
},
"servers": [
{
"url": "https://next-fast-turbo-api.vercel.app"
}
],
"paths": {
"/api/v1/users/get/": {
"get": {
"tags": [
"users"
],
"summary": "Get User",
"description": "Returns a user from a user_id.\n\n**Returns:**\n- User: User object.",
"operationId": "users-get_user",
"parameters": [
{
"name": "user_id",
"in": "query",
"required": true,
"schema": {
"type": "string",
"title": "User Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
},
"404": {
"description": "Not found"
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/users/get-all/": {
"get": {
"tags": [
"users"
],
"summary": "Get All Users",
"description": "Returns a list of all users.\n\n**Returns:**\n- list[User]: List of all users.",
"operationId": "users-get_all_users",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/User"
},
"type": "array",
"title": "Response Users-Get All Users"
}
}
}
},
"404": {
"description": "Not found"
}
}
}
},
"/api/v1/users/search/": {
"get": {
"tags": [
"users"
],
"summary": "Search Users",
"description": "Search for users based on a keyword and return the top `max_results` items.\n\n**Args:**\n- keyword (str, optional): The keyword to search for. Defaults to None.\n- max_results (int, optional): The maximum number of search results to return. Defaults to 10.\n- search_on (str, optional): The field to perform the search on. Defaults to \"email\".\n\n**Returns:**\n- UserSearchResults: Object containing a list of the top `max_results` items that match the keyword.",
"operationId": "users-search_users",
"parameters": [
{
"name": "search_on",
"in": "query",
"required": false,
"schema": {
"enum": [
"id",
"email",
"forename",
"surname"
],
"type": "string",
"default": "email",
"title": "Search On"
}
},
{
"name": "keyword",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Keyword"
}
},
{
"name": "max_results",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": 10,
"title": "Max Results"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserSearchResults"
}
}
}
},
"404": {
"description": "Not found"
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/users/create": {
"post": {
"tags": [
"users"
],
"summary": "Create User",
"description": "Craete a new user.\n\n**Args:**\n- user_in (UserCreate): JSON of the user to create. Forename, surname and email. Email must be unique.\n\n**Returns:**\n- User: User object",
"operationId": "users-create_user",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserCreate"
}
}
},
"required": true
},
"responses": {
"201": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
},
"404": {
"description": "Not found"
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/spells/get/": {
"get": {
"tags": [
"spells"
],
"summary": "Get Spell",
"description": "Returns a spell from a spell_id.\n\n**Returns:**\n- spell: spell object.",
"operationId": "spells-get_spell",
"parameters": [
{
"name": "spell_id",
"in": "query",
"required": true,
"schema": {
"type": "string",
"title": "Spell Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Spell"
}
}
}
},
"404": {
"description": "Not found"
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/spells/get-all/": {
"get": {
"tags": [
"spells"
],
"summary": "Get All Spells",
"description": "Returns a list of all spells.\n\n**Returns:**\n- list[spell]: List of all spells.",
"operationId": "spells-get_all_spells",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/Spell"
},
"type": "array",
"title": "Response Spells-Get All Spells"
}
}
}
},
"404": {
"description": "Not found"
}
}
}
},
"/api/v1/spells/search/": {
"get": {
"tags": [
"spells"
],
"summary": "Search Spells",
"description": "Search for spells based on a keyword and return the top `max_results` items.\n\n**Args:**\n- keyword (str, optional): The keyword to search for. Defaults to None.\n- max_results (int, optional): The maximum number of search results to return. Defaults to 10.\n- search_on (str, optional): The field to perform the search on. Defaults to \"email\".\n\n**Returns:**\n- spellSearchResults: Object containing a list of the top `max_results` items that match the keyword.",
"operationId": "spells-search_spells",
"parameters": [
{
"name": "search_on",
"in": "query",
"required": false,
"schema": {
"enum": [
"id",
"spells",
"description"
],
"type": "string",
"default": "spells",
"title": "Search On"
}
},
{
"name": "keyword",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Keyword"
}
},
{
"name": "max_results",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": 10,
"title": "Max Results"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SpellSearchResults"
}
}
}
},
"404": {
"description": "Not found"
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"HTTPValidationError": {
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
},
"Spell": {
"properties": {
"id": {
"type": "string",
"title": "Id"
},
"name": {
"type": "string",
"title": "Name"
},
"description": {
"type": "string",
"title": "Description"
}
},
"type": "object",
"required": [
"id",
"name",
"description"
],
"title": "Spell"
},
"SpellSearchResults": {
"properties": {
"results": {
"items": {
"$ref": "#/components/schemas/Spell"
},
"type": "array",
"title": "Results"
}
},
"type": "object",
"required": [
"results"
],
"title": "SpellSearchResults"
},
"User": {
"properties": {
"id": {
"type": "string",
"title": "Id"
},
"forename": {
"type": "string",
"title": "Forename"
},
"surname": {
"type": "string",
"title": "Surname"
},
"email": {
"type": "string",
"format": "email",
"title": "Email"
}
},
"type": "object",
"required": [
"id",
"forename",
"surname",
"email"
],
"title": "User"
},
"UserCreate": {
"properties": {
"forename": {
"type": "string",
"title": "Forename"
},
"surname": {
"type": "string",
"title": "Surname"
},
"email": {
"type": "string",
"format": "email",
"title": "Email"
}
},
"type": "object",
"required": [
"forename",
"surname",
"email"
],
"title": "UserCreate"
},
"UserSearchResults": {
"properties": {
"results": {
"items": {
"$ref": "#/components/schemas/User"
},
"type": "array",
"title": "Results"
}
},
"type": "object",
"required": [
"results"
],
"title": "UserSearchResults"
},
"ValidationError": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
}
}
}
}