Skip to main content

Falcon requests validation against OpenAPI (Swagger) schema

Project description

Falguard is a Python library that provides request validation helpers for Falcon web framework. Falguard relies on Yelp’s bravado-core library.


  • Validation of OpenAPI (Swagger) schema

  • Error serialization compliant with JSON:API specification

  • Validator may be used either as a hook or a middleware component


$ pip install falguard


Instantiate Validator with the path to OpenAPI specification (both json and yaml are supported)…

import falguard

validator = falguard.Validator('spec.json')

…and use it as the hook on the responder…

class Resource:

    def on_get(self, request, response, **validated):

…or the hook on the whole resource…

class Resource:

…or globally, as the middleware component.

import falcon

api = falcon.API(middleware=validator)

All validated parameters (path, query, body) are injected back to the responder so it MUST accept relevant number of arguments, eg.

class Resource:

    def on_put(self, request, response, resource_id, data):

    def on_post(self, request, response, **validated):

Project details

Download files

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

Source Distributions

No source distribution files available for this release. See tutorial on generating distribution archives.

Built Distribution

falguard-0.4-py2.py3-none-any.whl (4.0 kB view hashes)

Uploaded py2 py3

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