bartongroup / slivka

http://bartongroup.github.io/slivka/
Apache License 2.0
7 stars 3 forks source link

Allow adding non-standard media type validators. #86

Closed warownia1 closed 4 years ago

warownia1 commented 4 years ago

System administrators should be able to create and add additional media-type validators with more specific constraints. A validator should be a callable (stream, properties={}) -> None which raises a ValidationError if the validation does not succeed. It can be accomplished by adding a map of media type to validator function path to settings. The path will be resolved and imported as a function just like with the limiters.