-
Notifications
You must be signed in to change notification settings - Fork 280
Dredd/Gavel incorrectly validates response body as valid when a JSON schema contains definitions and $ref #254
Comments
+1 |
this should work, Dredd/Gavel should support both Json Schema v3 and v4. This is a v4 feature, but the functionality in Dredd depends on underlaying JSON schema validator. I suspect it's a bug or feature of this validator. I'll investigate further... |
@netmilk I am also experiencing this. Any news? :) |
@joaosa this is the issue we're solving in apiaryio/gavel.js#25, right? |
@honzajavorek yes that seems to be the case. Must've mixed the issues |
No problem, just linking it together
…On Thu, 9 Mar 2017 at 07:35, João Sousa Andrade ***@***.***> wrote:
@honzajavorek <https://github.com/honzajavorek> yes that seems to be the
case. Must've mixed the issues
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#254 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AARTMWDxr6imULAeayWzRffS2Doqe1I6ks5rj52agaJpZM4Fe3kT>
.
|
Does #767 also address this issue for swagger specifications? I would assume so, since I am using swagger 2.0 which utilizes json schema draft 4. Only asking because I just installed from master and seem to be having this problem still. EDIT: Scratch that, it was an error on my end where the dredd CLI command was still looking at the build installed from npm. Master seems to be working fine, thank you! |
@mrname Good! I'm glad it works. |
Should be fixed in Dredd v3.4.2. |
Update sinon to the latest version 🚀
I have noticed that dredd incorrectly marks my API responses as valid if I supply a JSON Schema that uses "definitions" as outlined here.
My server is returning the following JSON for a simple GET request:
My API Blueprint has two test cases, one that validates the above JSON against a JSON Schema expecting the "address" object to contain three fields. The second request uses a JSON Schema that extracts the "address" object into a definition and references this with a JSON Pointer.
As expected the first request is failing with message
body: At '/address/country' Missing required property: country
. But the second request is happily passing.Should dredd/Gavel be supporting these JSON Schema features?
The text was updated successfully, but these errors were encountered: