File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,14 @@ def test_if_request_has_body_validator(self):
166
166
def test_request_validate_body_with_no_request_model (self ):
167
167
apigateway_client = self ._mock_client ()
168
168
apigateway_client .get_request_validator .return_value = {"validateRequestBody" : True }
169
+ empty_schema = json .dumps (
170
+ {
171
+ "$schema" : "http://json-schema.org/draft-04/schema#" ,
172
+ "title" : "Empty Schema" ,
173
+ "type" : "object" ,
174
+ }
175
+ )
176
+ apigateway_client .get_model .return_value = {"schema" : empty_schema }
169
177
ctx = ApiInvocationContext ("POST" , "/" , '{"id":"1"}' , {})
170
178
ctx .api_id = "deadbeef"
171
179
ctx .resource = {
@@ -177,7 +185,7 @@ def test_request_validate_body_with_no_request_model(self):
177
185
}
178
186
}
179
187
validator = RequestValidator (ctx , apigateway_client )
180
- self .assertFalse (validator .is_request_valid ())
188
+ self .assertTrue (validator .is_request_valid ())
181
189
182
190
def test_request_validate_body_with_no_model_for_schema_name (self ):
183
191
apigateway_client = self ._mock_client ()
You can’t perform that action at this time.
0 commit comments