Router Tags

  • If you navigate to the DOCS page

  • Tags will allow us to group this documentation based on responsibility

  • Basically grouping them in "folders"

  • This is very easy to update

  • Withing the router variable we will have to add the tag

# post.py

# Before:
router = APIRouter(
    prefix="/posts"
)

# After:
router = APIRouter(
    prefix="/posts",
    tags=['Posts']
)

# user.py

# Before:
router = APIRouter(
    prefix="/users"
)

# After:
router = APIRouter(
    prefix="/users",
    tags=['Users']
)
  • Now this has updated our sections as follows:

  • This improved the readability

Last updated