Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

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

Open
Lreus opened this issue Jan 19, 2019 · 0 comments

Comments

@Lreus
Copy link

Lreus commented Jan 19, 2019

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 ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant