Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • Hi @TanThien, this is helpful although it describes catching runtime errors (important), rather than indicating errors in the type checker statically inherently for all requests. Commented Mar 7, 2024 at 1:30
  • @JackHales, what about you add a try/except for assert_type in after_request_handler. if format error it using code from except to override response. In my application, I use after_request_handler to put data to format {susscess: true, data: resposne.data} and controller only return the body data {hello: world!}. It is more standard because I have service name in response and the service name is a os ENV of container name. It is better than you add format return in each api Commented Mar 7, 2024 at 1:49