Fastapi: Document usage with Starlette

Created on 1 Oct 2020  路  4Comments  路  Source: tiangolo/fastapi

First check

  • [x] I added a very descriptive title to this issue.
  • [x] I used the GitHub search to find a similar issue and didn't find it.
  • [x] I searched the FastAPI documentation, with the integrated search.
  • [x] I already searched in Google "How to X in FastAPI" and didn't find any information.
  • [x] I already read and followed all the tutorial in the docs and didn't find an answer.
  • [x] I already checked if it is not related to FastAPI but to Pydantic.
  • [x] I already checked if it is not related to FastAPI but to Swagger UI.
  • [x] I already checked if it is not related to FastAPI but to ReDoc.
  • [x] After submitting this, I commit to one of:

    • Read open issues with questions until I find 2 issues where I can help someone and add a comment to help there.

    • I already hit the "watch" button in this repository to receive notifications and I commit to help at least 2 people that ask questions in the future.

    • Implement a Pull Request for a confirmed bug.

Description

Under the hood FastApi relies on Starlette.
And fastApi made a clear decision to relay on @decorator based routing, as otherwise it would split the definition of an endpoint over two files (route vs accepted data).

see FastAPI will keep the decorator style.

As Starlette sadly has dropped all of their @decorator based documentation, only the folks who used it before know how to use it, people starting out now have no way to easily retrieve that.

Therefore the old style of declaring (html) routes via decorators would probably be great to be documented in this project, as mixing decorator and non-decorator route declarations is really confusing.

This issue is basically the missing "but that's a different subject/issue" of the already linked issue.

My current Wishlist for documentation

  • [x] How to serve normal HTML (Starlette) pages
  • [x] startup and shutdown events

Environment

Doesn't really apply.

  • macOS, docker
  • FastAPI Version [e.g. 0.3.0]: Most recent

Additional context

None.

question

Most helpful comment

Thanks.
I tried to find it in the docs, but well maybe I didn't get enough coffee this morning.

All 4 comments

This could probably be tagged enhancement instead question, but I'm not able to change that.

Aren't we already have a documentation for HTML Response (see #1064) and Startup and Shutdown Events

Uh.

Thanks.
I tried to find it in the docs, but well maybe I didn't get enough coffee this morning.

Was this page helpful?
0 / 5 - 0 ratings