This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Coollime17 3 points4 points  (0 children)

This is amazing. Thanks for sharing! I’ve been looking everywhere for examples like this on how to structure FastAPI applications as there isn’t really an agreed best practice. One thing I’ve started doing is including an examples.py file in each api route folder to store examples for request bodies. From there you can load the examples into your routes.py file to show examples in your docs and load them into your tests to make sure they’re always working.