Skip to main content

Changes standard flask and jwt errors format

Project description

Flask Errors as Nested Dicts

This extension was developed for personal use and changes standard flask and jwt response errors to nested dicts, i. e.

{
  "code": 404,
  "status": "Not Found"
}

to:

{
  "errors": {
    "json": {
      "url": [
        "Does not exist."
      ]
    }
  }
}

Installing

Install and update using pip:

$ pip install flask-errors-as-nested-dicts

Usage

from flask import Flask
from flask_jwt_extended import JWTManager

app = Flask(__name__)
jwt = JWTManager(app)
ErrorsAsNestedDicts(app, jwt)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask-errors-as-nested-dicts-0.0.1.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page