88import warnings
99
1010from six import iteritems , integer_types , binary_type , text_type
11+ from uuid import UUID
1112
1213from openapi_core .extensions .models .factories import ModelFactory
1314from openapi_core .schema .schemas .enums import SchemaFormat , SchemaType
@@ -46,6 +47,7 @@ class Schema(object):
4647 SchemaFormat .DATE : Format (format_date , TypeValidator (date , exclude = datetime )),
4748 SchemaFormat .DATETIME : Format (format_datetime , TypeValidator (datetime )),
4849 SchemaFormat .BINARY : Format (binary_type , TypeValidator (binary_type )),
50+ SchemaFormat .UUID : Format (UUID , TypeValidator (UUID )),
4951 }
5052
5153 TYPE_VALIDATOR_CALLABLE_GETTER = {
@@ -54,7 +56,7 @@ class Schema(object):
5456 SchemaType .INTEGER : TypeValidator (integer_types , exclude = bool ),
5557 SchemaType .NUMBER : TypeValidator (integer_types , float , exclude = bool ),
5658 SchemaType .STRING : TypeValidator (
57- text_type , date , datetime , binary_type ),
59+ text_type , date , datetime , binary_type , UUID ),
5860 SchemaType .ARRAY : TypeValidator (list , tuple ),
5961 SchemaType .OBJECT : AttributeValidator ('__dict__' ),
6062 }
0 commit comments