contexts icon indicating copy to clipboard operation
contexts copied to clipboard

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

Open Lreus opened this issue 7 years ago • 0 comments

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 ?

Lreus avatar Jan 19 '19 14:01 Lreus