Closed rohitnick closed 8 years ago
@rohitnick What do you think about adding these parameters to the JSON schema as optional fields? Was there a reason that wouldn't work?
Thanks for your work here! Exciting to see this project pick up steam!
@iloveitaly Essentially what you are saying will definitely work and should be the right way of doing things. Adding the additional parameters to the JSON schema as optional fields will also solve this issue.
I was in a hurry and didn't wanted to go through the 'json-schema' gem so fixed the issue by removing the parameters.
This PR helped me to go forward with my chaindrive_integration but i had a JSON Validator problem until i've made this change :
diff --git a/app/jobs/cangaroo/poll_job.rb b/app/jobs/cangaroo/poll_job.rb
index b152c07..9c49897 100644
--- a/app/jobs/cangaroo/poll_job.rb
+++ b/app/jobs/cangaroo/poll_job.rb
@@ -30,7 +30,7 @@ module Cangaroo
command = HandleRequest.call(
key: destination_connection.key,
token: destination_connection.token,
- json_body: response.to_json,
+ json_body: response,
jobs: Rails.configuration.cangaroo.jobs
)
@rohitnick can you rebase master and make specs pass? If you don't want do it let me know and I'll fix it.
@AlessioRocco : I can fix this but it can take me upto 48 hrs, as I am busy with other stuff. If you can fix it faster, please do. :)
@rohitnick I had some time today and I've fixed it with this PR, I've stolen the solution from you so thanks for your work.
context.json_body
can also includeparameters
in addition torequest_id
andsummary
, which is as per the guidelines given by wombat.Therefore removing it from
context.json_body
before validating objects schema.fixes #22