Skip to content
Snippets Groups Projects

Add API documentation

Merged Konrad Mohrfeldt requested to merge feature/api-docs into master
2 files
+ 9
0
Compare changes
  • Side-by-side
  • Inline
Files
2
  • ab4c64d2
    This change allows clients to identify specific errors by an optional
    code provided as part of any APIException instances raised in our code.
    
    This code:
    
    ```py
    raise ValidationError(
        "Please provide a correct date and time",
        code="time-invalid",
    )
    ```
    
    now returns an error object via the API with a message and a code
    property making error processing on the client side easy for both humans
    and machines and looks like this:
    
    ```json
    {
        "message": "Please provide a correct date and time",
        "code": "time-invalid"
    }
    ```
+ 1
0
@@ -109,6 +109,7 @@ REST_FRAMEWORK = {
"program.auth.OidcOauth2Auth",
],
"DEFAULT_FILTER_BACKENDS": ["django_filters.rest_framework.DjangoFilterBackend"],
"EXCEPTION_HANDLER": "steering.views.full_details_exception_handler",
}
INSTALLED_APPS = (
Loading