Closed zueve closed 5 years ago
validators.String
already supports auto validation of date, time and datetime strings using format=date
, format=time
and format=datetime
respectively. Please comment on whether these are sufficient.
it's support if i use complex validator like
class Product(typing.Type):
date = validators.Date()
def myhandler (product: Product):
pass
But I wont validate data type out of complex validator(Product), like in example:
def myhandler (date: datetime.date):
pass
ah, I see what you mean. You want a toplevel data element that is not an object. See #507 where the user wanted a toplevel array element instead of an object. The JSON spec has changed slightly from the past in terms of the definition of a JSON document. Previously only {}
and []
were allowed root elements.
I guess we will wait for @tomchristie to chime in on what he wants to support.
Now redundant, given we're using https://github.com/encode/typesystem for all the validation here.
It will grate to auto validate base types date / datetime Now the API can not validate only: str, int, float and can not catch date / datetime.
Example:
`
from datetimedef myhandler (name: str, created: date): pass
`
Now i have an exception: No component able to handle parameter "date" on function "myhandlee"If you agree i would like to make patch