Skip to main content

Falguard travis codecov python-versions

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

Features

  • Validation of OpenAPI (Swagger) schema

  • Error serialization compliant with JSON:API specification

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

Installation

$ pip install falguard

Usage

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:

    @falcon.before(validator)
    def on_get(self, request, response, **validated):
        pass

…or the hook on the whole resource…

@falcon.before(validator)
class Resource:
    pass

…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):
        pass

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

Release files for falguard 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for falguard 0.4
File Interpreter ABI Platform
falguard-0.4-py2.py3-none-any.whl Python 3, Python 2 none any Details

Release files / falguard-0.4-py2.py3-none-any.whl

Download URL falguard-0.4-py2.py3-none-any.whl
Size 4.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c00b5752bbf6cc650f77f9035a49af4297b3faca3d2cb2b89e2716fb933c0f9a
BLAKE2b-256 checksum
How to use checksums
f55ea743739a5761e6b774dbe86c22ed83bd634796df2962ca25936140722bd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

Release history Release notifications | RSS feed

This release

0.4 This release

1 release file

0.3

2 release files

0.2

2 release files

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page