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

Add new step validating by reciprocity JSON payload against schema#111

Closed
gmorel wants to merge 5 commits intoBehatch:behat-2.xfrom
gmorel:feature/add_reciprocity_test_on_json_schema
Closed

Add new step validating by reciprocity JSON payload against schema#111
gmorel wants to merge 5 commits intoBehatch:behat-2.xfrom
gmorel:feature/add_reciprocity_test_on_json_schema

Conversation

@gmorel
Copy link
Copy Markdown

@gmorel gmorel commented Jan 7, 2015

Hi

A new Step:

the JSON should be invalid according to the schema "(?P<filename>[^"]*)"

Basically we noticed sometimes our tests validating Json payload against JSON Schema were not relevant. This was because of a small error on our JSON schema. This should ease JSON schema relevancy validation/debug.


A concrete example

You have a JsonSchema validating a Json payload. This JsonSchema includes another JsonSchema and you get the feeling that the included JsonSchema is ignored. Hence your Json payload seems always valid.
By modifying the included JsonSchema by renaming one of the payload key. You would expect that that your included JsonSchema will raise an error when using this step:

the JSON should be invalid according to the schema "(?P<filename>[^"]*)"

If not you might have found a deeper issue.

Cheers

stephpy and others added 5 commits December 29, 2014 12:24
…hem when reset/restart session. They are on Behat\Mink\Driver\BrowserKitDriver and there is no way to get them.
the JSON should be invalid according to the schema "(?P<filename>[^"]*)"
This should ease JSON schema relevancy validation
@gmorel
Copy link
Copy Markdown
Author

gmorel commented Feb 2, 2015

ping @sanpii

@sanpii
Copy link
Copy Markdown
Member

sanpii commented Feb 11, 2015

Hello,

I have somes problems with this PR:

  • The behat-2.x branch is bug fix only ;
  • This method is a copy/paste of theJsonShouldBeValidAccordingToTheSchema() ;
  • No test.

@sanpii
Copy link
Copy Markdown
Member

sanpii commented Apr 4, 2016

The PR #155 has added this feature. Can I close this PR?

@gmorel
Copy link
Copy Markdown
Author

gmorel commented Apr 4, 2016

👍

@gmorel gmorel closed this Apr 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants