From f700a0649ac7bc0e854e70d3f968ebf22cf90a33 Mon Sep 17 00:00:00 2001 From: Sidnev Nikolaj Date: Thu, 27 Jun 2019 16:47:19 +0300 Subject: [PATCH] fix error in examples --- README.md | 8 ++++---- docs/development/first-steps.md | 8 ++++---- docs/index.md | 8 ++++---- scripts/build-docs.sh | 2 ++ 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index c8e1c500..01df3156 100644 --- a/README.md +++ b/README.md @@ -81,12 +81,12 @@ app.add_middleware( ) -@app.get("/status", response_model=Status, status_code=HTTP_202_ACCEPTED) +@app.get("/status", response_model=Status) def bot_status(): return bot.status -@app.post("/command") +@app.post("/command", status_code=HTTP_202_ACCEPTED) def bot_command(message: Message): bot.execute_command(message.dict()) ``` @@ -120,12 +120,12 @@ app.add_event_handler("startup", bot.start) app.add_event_handler("shutdown", bot.stop) -@app.get("/status", response_model=Status, status_code=HTTP_202_ACCEPTED) +@app.get("/status", response_model=Status) async def bot_status(): return bot.status -@app.post("/command") +@app.post("/command", status_code=HTTP_202_ACCEPTED) async def bot_command(message: Message): await bot.execute_command(message.dict()) ``` diff --git a/docs/development/first-steps.md b/docs/development/first-steps.md index b551f61b..f9e7ff58 100644 --- a/docs/development/first-steps.md +++ b/docs/development/first-steps.md @@ -111,12 +111,12 @@ You must call them to be sure that the bot will work properly. ```Python3 hl_lines="4 9" ... -@app.get("/status", response_model=Status, status_code=HTTP_202_ACCEPTED) +@app.get("/status", response_model=Status) def bot_status(): return bot.status -@app.post("/command") +@app.post("/command", status_code=HTTP_202_ACCEPTED) def bot_command(message: Message): bot.execute_command(message.dict()) ... @@ -404,12 +404,12 @@ app.add_middleware( ) -@app.get("/status", response_model=Status, status_code=HTTP_202_ACCEPTED) +@app.get("/status", response_model=Status) def bot_status(): return bot.status -@app.post("/command") +@app.post("/command", status_code=HTTP_202_ACCEPTED) def bot_command(message: Message): bot.execute_command(message.dict()) ``` \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index c8e1c500..01df3156 100644 --- a/docs/index.md +++ b/docs/index.md @@ -81,12 +81,12 @@ app.add_middleware( ) -@app.get("/status", response_model=Status, status_code=HTTP_202_ACCEPTED) +@app.get("/status", response_model=Status) def bot_status(): return bot.status -@app.post("/command") +@app.post("/command", status_code=HTTP_202_ACCEPTED) def bot_command(message: Message): bot.execute_command(message.dict()) ``` @@ -120,12 +120,12 @@ app.add_event_handler("startup", bot.start) app.add_event_handler("shutdown", bot.stop) -@app.get("/status", response_model=Status, status_code=HTTP_202_ACCEPTED) +@app.get("/status", response_model=Status) async def bot_status(): return bot.status -@app.post("/command") +@app.post("/command", status_code=HTTP_202_ACCEPTED) async def bot_command(message: Message): await bot.execute_command(message.dict()) ``` diff --git a/scripts/build-docs.sh b/scripts/build-docs.sh index 024cb5d3..33e479b4 100755 --- a/scripts/build-docs.sh +++ b/scripts/build-docs.sh @@ -3,3 +3,5 @@ set -e python -m mkdocs build + +cp ./docs/index.md ./README.md \ No newline at end of file