Behatch / contexts

Behat extension with most custom helper steps
Other
393 stars 203 forks source link

Unable to use step "the JSON should be valid according to swagger :dumpPath dump schema :schemaName" #270

Open Lreus opened 5 years ago

Lreus commented 5 years ago

Hello, It seems I am unable to validate a json repsonse from a controller as a valid schema defined in swagger json.

Attached screenshot test passes if my swagger.json contains the code below get_children

{ "swagger": "2.0", "info": { "version": "1", "title": "my client" }, "consumes": [ "application/json" ], "produces": [ "application/json" ], "securityDefinitions": { "GatewayToken": { "type": "apiKey", "in": "header", "name": "X-Authenticated-UserID" } }, "paths": { "/children": { "get": { "tags": [ "children" ], "summary": "One children wit its parent", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Parent" } } } } } }, "definitions": { "Parent": { "type": "object", "properties": { "name": { "type": "string" }, "job": { "type": "string" }, "children": { "allOf": [ { "$ref": "#/definitions/Children" } ] } } }, "Children": { "type": "object", "properties": { "firstName": { "type": "string" } } } } } Object key is not 'firstName' but 'name' and the test pass. Did I miss something ?