8
8
import warnings
9
9
10
10
from six import iteritems , integer_types , binary_type , text_type
11
+ from uuid import UUID
11
12
12
13
from openapi_core .extensions .models .factories import ModelFactory
13
14
from openapi_core .schema .schemas .enums import SchemaFormat , SchemaType
@@ -46,6 +47,7 @@ class Schema(object):
46
47
SchemaFormat .DATE : Format (format_date , TypeValidator (date , exclude = datetime )),
47
48
SchemaFormat .DATETIME : Format (format_datetime , TypeValidator (datetime )),
48
49
SchemaFormat .BINARY : Format (binary_type , TypeValidator (binary_type )),
50
+ SchemaFormat .UUID : Format (UUID , TypeValidator (UUID )),
49
51
}
50
52
51
53
TYPE_VALIDATOR_CALLABLE_GETTER = {
@@ -54,7 +56,7 @@ class Schema(object):
54
56
SchemaType .INTEGER : TypeValidator (integer_types , exclude = bool ),
55
57
SchemaType .NUMBER : TypeValidator (integer_types , float , exclude = bool ),
56
58
SchemaType .STRING : TypeValidator (
57
- text_type , date , datetime , binary_type ),
59
+ text_type , date , datetime , binary_type , UUID ),
58
60
SchemaType .ARRAY : TypeValidator (list , tuple ),
59
61
SchemaType .OBJECT : AttributeValidator ('__dict__' ),
60
62
}
0 commit comments