Skip to content

matino/falcon-json

Repository files navigation

Falcon JSON

Small set of JSON utilities for Python Falcon framework.

Falcon doesn't currently provide JSON deserialization and most of the time you need one.

Example code:

import falcon

schema = {
    'type': 'object',
    'required': ['first_name', 'last_name'],
    'properties': {
        'first_name': {
            'type' : 'string',
        },
        'last_name': {
            'type' : 'string',
        },
    },
}


class People(object):

    @falcon.before(hooks.process_json_request)
    @falcon.before(hooks.validate_json_schema(schema))
    def on_post(self, request, response):
        # Validated JSON request body goes here:
        data = resp.context['json']

About

Small set of JSON utilities for Python Falcon framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages