1. Timothy Corbett-Clark
  2. rest-api-blueprint

Wiki

Clone wiki

rest-api-blueprint / CleanExpression

Separating the concerns

There should be a clean separation of all the web and REST machinery from the underlying entities and workflow logic. Further, the Flask routing/view code should clearly express the "different cogs" in the machine:

  • URL routing and parsing
  • Authentication and capabilities
  • API versioning
  • Parsing, validating, and marshalling the input and output data structures, including mimetypes
  • Character encoding and decoding (if necessary)
  • Error handling, including correct use of HTTP status codes

See views.py and the blueprints.

Updated