-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expect_json_types for elements of an array not working #94
Comments
Is |
Pretty sure thats not valid JSON. It should look like:
|
Yes Seth, description is a key on a bigger object. And yes, what I had earlier posted was not a valid json. What you have corrected is the valid one. |
An update on this issue :- I'm able to do schema validation for all arrays but not able to do the same for any of the arrays. So, But, It still checks all arrays. My Scenario: I have a json response of programs in which the majority of programs have descriptions which consist of an array of hashes, but for one particular program the description key is null. So my test has inevitably become if any of the description key matches the following schema. Thanks for your support once again. :) Regards, |
Hi,
I want to validate the json schema for an array and it's elements but I'm unable to do that with Airborne. Continuously getting errors.
Here is part of my data :-
description: [
{
program_id: 317103604,
program_description: "This animated series tells of the adventures of boy reporter Tintin, his dog, Snowy, and their friend Captain Haddock. From the stories by Herge.",
program_description_type: "Generic Description"
},
{
program_id: 317103604,
program_description: "Go on wild adventures with a boy reporter Tintin, his dog and Captain Haddock.",
program_description_type: "Generic Description"
}
]
So as per documentation if I try this :-
expect_json_types('description.*',program_id: :integer, program_description: :string, program_description_type: :string)
I must be able to validate the json types but I'm getting this error :-
Failures:
Failure/Error: expect_json_types('description.*',program_id: :integer, program_description: :string, program_description_type: :string)
Finished in 0.61998 seconds (files took 0.41055 seconds to load)
1 example, 1 failure
Please can you look into this. issue.
The text was updated successfully, but these errors were encountered: