1- from openapi_core .schema .exceptions import OpenAPIMappingError
2-
31import attr
42
3+ from openapi_core .schema .exceptions import OpenAPIMappingError
4+
55
66class OpenAPISchemaError (OpenAPIMappingError ):
77 pass
88
99
10- @attr .s
10+ @attr .s ( hash = True )
1111class NoValidSchema (OpenAPISchemaError ):
1212 value = attr .ib ()
1313
1414 def __str__ (self ):
1515 return "No valid schema found for value: {0}" .format (self .value )
1616
1717
18- @attr .s
18+ @attr .s ( hash = True )
1919class UndefinedItemsSchema (OpenAPISchemaError ):
2020 type = attr .ib ()
2121
2222 def __str__ (self ):
2323 return "Null value for schema type {0}" .format (self .type )
2424
2525
26- @attr .s
26+ @attr .s ( hash = True )
2727class InvalidSchemaValue (OpenAPISchemaError ):
2828 msg = attr .ib ()
2929 value = attr .ib ()
@@ -32,58 +32,60 @@ class InvalidSchemaValue(OpenAPISchemaError):
3232 def __str__ (self ):
3333 return self .msg .format (value = self .value , type = self .type )
3434
35- @attr .s
35+
36+ @attr .s (hash = True )
3637class InvalidCustomFormatSchemaValue (InvalidSchemaValue ):
3738 original_exception = attr .ib ()
3839
3940 def __str__ (self ):
4041 return self .msg .format (value = self .value , type = self .type , exception = self .original_exception )
4142
4243
43- @attr .s
44+ @attr .s ( hash = True )
4445class UndefinedSchemaProperty (OpenAPISchemaError ):
4546 extra_props = attr .ib ()
4647
4748 def __str__ (self ):
4849 return "Extra unexpected properties found in schema: {0}" .format (self .extra_props )
4950
50- @attr .s
51+
52+ @attr .s (hash = True )
5153class InvalidSchemaProperty (OpenAPISchemaError ):
5254 property_name = attr .ib ()
5355 original_exception = attr .ib ()
5456
5557 def __str__ (self ):
5658 return "Invalid schema property {0}: {1}" .format (self .property_name , self .original_exception )
5759
58- @attr .s
60+
61+ @attr .s (hash = True )
5962class MissingSchemaProperty (OpenAPISchemaError ):
6063 property_name = attr .ib ()
6164
6265 def __str__ (self ):
6366 return "Missing schema property: {0}" .format (self .property_name )
6467
6568
66- @attr .s
69+ @attr .s ( hash = True )
6770class NoOneOfSchema (OpenAPISchemaError ):
6871 type = attr .ib ()
6972
7073 def __str__ (self ):
7174 return "Exactly one valid schema type {0} should be valid, None found." .format (self .type )
7275
7376
74- @attr .s
77+ @attr .s ( hash = True )
7578class MultipleOneOfSchema (OpenAPISchemaError ):
7679 type = attr .ib ()
7780
7881 def __str__ (self ):
7982 return "Exactly one schema type {0} should be valid, more than one found" .format (self .type )
8083
8184
82- class UnmarshallerError (Exception ):
85+ class UnmarshallerError (OpenAPIMappingError ):
8386 pass
8487
8588
86- @attr .s
8789class UnmarshallerStrictTypeError (UnmarshallerError ):
8890 value = attr .ib ()
8991 types = attr .ib ()
0 commit comments