Releases: gridsmartercities/aws-lambda-decorators
Releases · gridsmartercities/aws-lambda-decorators
Decoder Caching
- json and jwt decoders are now caching. Extracting multiple parameters from the same json/jwt property will only decode from json/jwt once.
- bug fix on Mandatory checks. Empty values are also checked.
Fixed calling mandatory validation statically
- Mandatory validators can be used statically
Min and Max Length validators
- Added MinLength and MaxLength validators
- Added ability to pass custom error messages to validators
Extract decorators can group errors
- extract_from_event and extract_from_context can now group errors
Grouping Validation Errors
- Added group_errors flag to both extract and validate decorators. By setting this flag to True, all errors for all parameters will be grouped together and returned as a list of key/value objects, where the key is the name of the validated property, and the value is a list of all the errors found when validating that parameter.
- Regular Expression validators do a full match now instead of a search.
New validators
- Added Maximum Value validator
- Added Minimum Value validator
Moved examples to its own repo
Examples have been moved to https://github.com/gridsmartercities/aws-lambda-decorators-examples, so new test.pypi releases can be tested against that repo easily.
Schema Validator
- Added schema validator. Check out
SchemaValidatorhere
CORS
Added cors decorator, which can add cors headers to the response of the decorated function (lambda)
Handle All Exceptions Decorator
- Added the handle_all_exceptions decorator that is able to catch any type of exception and return a 400 message back.
- Made the Exception friendly message optional in the handle_exceptions decorator.