jondkinney/docusign_rest

Convert the gem to take in json keys documented by the docusign API instead of the ruby underscore keys currently used

Closed this issue · 1 comments

This should allow the gem to be a bit more self-documenting. Things like needing to use label: instead of tabLabel: can be confusing.

Initially I thought I should try to make the interaction with the gem be more 'ruby-ish', but there's a downside...each of the keys we want to pass need to be implemented in the gem's code instead of allowing them to just be passed through to the API. I just ran into this specific situation where I wanted to set the width and height of a textLabel, and I had to add both width and height in the client.rb under the get_tabs method. This shouldn't be necessary.

I still want to make things easier than interacting with the API directly, for instance, setting some sane defaults for the required fields in case they're not passed. Those fields should be allowed to be overridden by user input of course.

Good thoughts. It's true that every time we need to support a new endpoint (and sometimes new parameters) we need to add new code and release a new gem.

More generally, currently this gem is a rather thin wrapper over the API. A client has to know a fair bit about what's expected to make a call - that is, you have to know what to put in the options hash. Seems like we could do a little more in terms of encapsulation. On the upside, the current design does allow a client app to easily monkeypatch in methods for wrapping additional endpoints as needed.