Skip to content

Support JSON Schema referencing in validation utils (by using fastjsonschema's handlers param) #4499

Closed
@danieljnchen

Description

@danieljnchen

Use case

fastjsonschema, which is used internally by aws-lambda-powertools' validation utilities, supports JSON Schema's schema referencing, but it by default launches an http request to the url provided. However, in the case that users don't want to launch an http request to fetch the referenced schemas (for example, because the references are stored locally), fastjsonschema also provides the handlers parameter to its validation methods (docs)

You can pass mapping from URI to function that should be used to retrieve remote schemes used in your definition in parameter handlers.

Solution/User Experience

Update aws-lambda-powertools' validation functions to support passing the handlers param to fastjsonschema's validate call. As far as I can tell, this would require adding the param to validate_data_against_schema and to the user-facing methods/decorators validate and validator

Alternative solutions

No response

Acknowledgment

Metadata

Metadata

Labels

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions