TelegramAktienBot/documentation/api/openapi.json

2 lines
12 KiB
JSON

{"components":{"schemas":{"AdminData":{"properties":{"admin":{"type":"boolean"},"username":{"type":"string"}},"type":"object"},"DeleteSuccessful":{"properties":{},"type":"object"},"DeleteUser":{"properties":{"username":{"type":"string"}},"type":"object"},"HTTPError":{"properties":{"detail":{"type":"object"},"message":{"type":"string"}},"type":"object"},"Keyword":{"properties":{"keyword":{"type":"string"}},"type":"object"},"KeywordResponse":{"properties":{"keyword":{"type":"string"},"s_id":{"type":"integer"},"user_id":{"type":"integer"}},"type":"object"},"LoginData":{"properties":{"password":{"type":"string"},"username":{"type":"string"}},"type":"object"},"Symbol":{"properties":{"symbol":{"type":"string"}},"type":"object"},"SymbolResponse":{"properties":{"s_id":{"type":"integer"},"symbol":{"type":"string"},"user_id":{"type":"integer"}},"type":"object"},"Token":{"properties":{"token":{"type":"string"}},"type":"object"},"Transaction":{"properties":{"count":{"type":"integer"},"price":{"type":"number"},"symbol":{"type":"string"},"time":{"type":"string"},"user_id":{"type":"integer"}},"type":"object"},"Users":{"properties":{"admin":{"type":"boolean"},"password":{"type":"string"},"telegram_name":{"type":"string"},"user_id":{"type":"integer"},"username":{"type":"string"}},"type":"object"},"ValidationError":{"properties":{"detail":{"properties":{"<location>":{"properties":{"<field_name>":{"items":{"type":"string"},"type":"array"}},"type":"object"}},"type":"object"},"message":{"type":"string"}},"type":"object"}},"securitySchemes":{"BearerAuth":{"scheme":"Bearer","type":"http"}}},"info":{"description":"Webengineering 2 | Telegram Aktienbot","title":"APIFlask","version":"0.0.1"},"openapi":"3.0.3","paths":{"/api/keyword":{"delete":{"description":"Removes existing keyword for current user","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Keyword"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/DeleteSuccessful"},"status":{"type":"integer"},"text":{"type":"string"}},"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Authentication error"}},"security":[{"BearerAuth":[]}],"summary":"Removes existing keyword","tags":["Keyword"]},"post":{"description":"Adds new keyword for current user","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Keyword"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/KeywordResponse"},"type":"array"},"status":{"type":"integer"},"text":{"type":"string"}},"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Authentication error"}},"security":[{"BearerAuth":[]}],"summary":"Add new keyword","tags":["Keyword"]}},"/api/keywords":{"get":{"description":"Returns all keywords for current user","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/KeywordResponse"},"type":"array"},"status":{"type":"integer"},"text":{"type":"string"}},"type":"object"}}},"description":"Successful response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Authentication error"}},"security":[{"BearerAuth":[]}],"summary":"Returns all keywords","tags":["Keyword"]}},"/api/portfolio":{"get":{"description":"Returns all shares of current user","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/200"},"status":{"type":"integer"},"text":{"type":"string"}},"type":"object"}}},"description":"Successful response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Authentication error"}},"security":[{"BearerAuth":[]}],"summary":"Returns portfolio","tags":["Portfolio"]}},"/api/share":{"delete":{"description":"Removes existing symbol for current user","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Symbol"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/DeleteSuccessful"},"status":{"type":"integer"},"text":{"type":"string"}},"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Authentication error"}},"security":[{"BearerAuth":[]}],"summary":"Removes existing symbol","tags":["Share"]},"post":{"description":"Adds new symbol for current user","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Symbol"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/SymbolResponse"},"type":"array"},"status":{"type":"integer"},"text":{"type":"string"}},"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Authentication error"}},"security":[{"BearerAuth":[]}],"summary":"Add new symbol","tags":["Share"]}},"/api/shares":{"get":{"description":"Returns all symbols for current user","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/SymbolResponse"},"type":"array"},"status":{"type":"integer"},"text":{"type":"string"}},"type":"object"}}},"description":"Successful response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Authentication error"}},"security":[{"BearerAuth":[]}],"summary":"Returns all symbols","tags":["Share"]}},"/api/transaction":{"post":{"description":"Adds new transaction for current user","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transaction"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/()"},"status":{"type":"integer"},"text":{"type":"string"}},"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Authentication error"}},"security":[{"BearerAuth":[]}],"summary":"Adds new transaction","tags":["Transaction"]}},"/api/transactions":{"get":{"description":"Returns all transactions for current user","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/Transaction"},"status":{"type":"integer"},"text":{"type":"string"}},"type":"object"}}},"description":"Successful response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Authentication error"}},"security":[{"BearerAuth":[]}],"summary":"Returns all transactions","tags":["Transaction"]}},"/api/user":{"delete":{"description":"Deletes user by username","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteUser"}}}},"responses":{"204":{"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Authentication error"}},"security":[{"BearerAuth":[]}],"summary":"Delete user","tags":["Users"]},"get":{"description":"Returns current user","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/Users"},"status":{"type":"integer"},"text":{"type":"string"}},"type":"object"}}},"description":"Successful response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Authentication error"}},"security":[{"BearerAuth":[]}],"summary":"Get current user","tags":["Users"]},"put":{"description":"Changes password and/or username of current user","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginData"}}}},"responses":{"204":{"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Authentication error"}},"security":[{"BearerAuth":[]}],"summary":"Update user","tags":["Users"]}},"/api/user/login":{"post":{"description":"Returns jwt token if username and password match, otherwise returns error","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginData"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/Token"},"status":{"type":"integer"},"text":{"type":"string"}},"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"}},"summary":"Login","tags":["Users"]}},"/api/user/register":{"post":{"description":"Registers user","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginData"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/Users"},"status":{"type":"integer"},"text":{"type":"string"}},"type":"object"}}},"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"}},"summary":"Register","tags":["Users"]}},"/api/user/setAdmin":{"put":{"description":"Set admin state of specified user","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminData"}}}},"responses":{"204":{"description":"Successful response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Authentication error"}},"security":[{"BearerAuth":[]}],"summary":"Set user admin state","tags":["Users"]}},"/api/users":{"get":{"description":"Returns all existing users as array","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Users"},"type":"array"},"status":{"type":"integer"},"text":{"type":"string"}},"type":"object"}}},"description":"Successful response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPError"}}},"description":"Authentication error"}},"security":[{"BearerAuth":[]}],"summary":"Get all users","tags":["Users"]}}},"servers":[{"name":"Production","url":"https://aktienbot.flokaiser.com"},{"name":"Local","url":"http://127.0.0.1:5000"}],"tags":[{"name":"Keyword"},{"name":"Share"},{"name":"Transaction"},{"name":"Portfolio"},{"name":"Users"}]}