# Path: falsy/utils/marshmallow.py
# def mm_check(routes, req, **kwargs):
#     sig = req.spec['route_signature']
#     args = routes.get(sig)
#     schema = argmap2schema(args)
#     e = schema.validate(kwargs)
#     if e:
#         raise MMException(str(e))


from marshmallow import fields
from falsy.utils.marshmallow import mm_check


route_args = {
    '/get/v1/hello': {
        'name': fields.Str(required=False),
    },
    '/post/v1/hello': {
        'name': fields.Str(validate=lambda p: len(p) >= 4)
    }
}


def mmcheck(req, resp, **kwargs):

# Path: falsy/utils/marshmallow.py
# def mm_check(routes, req, **kwargs):
#     sig = req.spec['route_signature']
#     args = routes.get(sig)
#     schema = argmap2schema(args)
#     e = schema.validate(kwargs)
#     if e:
#         raise MMException(str(e))


# Path: demo/mm/ops/validate.py
from marshmallow import fields
from falsy.utils.marshmallow import mm_check



route_args = {
    '/get/v1/hello': {
        'name': fields.Str(required=False),
    },
    '/post/v1/hello': {
        'name': fields.Str(validate=lambda p: len(p) >= 4)
    }
}


def mmcheck(req, resp, **kwargs):

    mm_check(route_args, req, **kwargs)