rightsignature / rightsignature-api

Ruby wrapper for RightSignature API
20 stars 20 forks source link

Some fields are sometimes arrays, sometimes hashes #23

Open rangerscience opened 7 years ago

rangerscience commented 7 years ago

Among other locations, when retrieving a document, you can have these structures:

"pages"=>
  {"page"=>
    [{"page_number"=>"1", "original_template_guid"=>"redacted", "original_template_filename"=>"redacted.pdf"},
     {"page_number"=>"2", "original_template_guid"=>"redacted", "original_template_filename"=>"redacted.pdf"}]},

 "pages"=>
  {"page"=>
    {"page_number"=>"1", "original_template_guid"=>"redacted", "original_template_filename"=>"redacted.pdf"}},

Same for audit_trails, and probably other locations.

This is clearly an artifact from XML conversions, but holy fuck, it is a pain when your schema can be so weirdly different.

mwean commented 6 years ago

We just ran into a production incident because of this. It's very problematic to have inconsistent responses.