-
Notifications
You must be signed in to change notification settings - Fork 3
Boolean options submitted to API in Python style #17
Comments
Hi, @reefdog! You may not know this, but I'm a big fan of DocumentCloud, which is why I created this package. I am actually fairly goosebumped (is that a verb?) that one of its developers is checking out my code! Do you all do autographs? Anyhoo, your point about Python and its capitalized You'll see from 743b78e that I've removed I've also clarified usage in the docs. Hope this solves any further issues and hope you have a nice day! |
Anthony, haha, we're actually a very approachable bunch, unless you want to talk prog rock. Then blood can get spilled. But for all other topics, feel free to reach out any time! Thanks for fixing this, our exception logs are in better shape for it, and I know the entire team is thankful for that. Keep on keepin on, and if you ever need help interacting with the API, I'd recommend shooting an email to [email protected], who keeps our docs ship-shape and has a great handle on things. Cheers! |
I've been thinking about this issue a bit, because it struck me as odd why requests doesn't automatically convert the payload to a JSON boolean object, Would the post request to the API accept these params as "data" rather than "args"? Looking in the requests docs, it appears that you could use the You could do something like this to avoid the extra lines of conversions to strings :
Not 100% certain this would work, but thought I'd mention it just in case. |
@tommeagher You make a good point; re-opening for more investigation. Thank you! |
I applaud @tommeagher for side-stepping Tony's and my game of pretend and actually tackling the issue at hand. 👏 |
Oh, do you two know each other? |
We've crossed paths once or twice. |
Hi there @anthonydb, this is @reefdog, a developer with DocumentCloud. We're really excited that you've written this impressive library for interacting with our API, and want to be of any help we can.
We noticed that when users of pneumatic set boolean options (like
force_ocr
), it hits our server with Python-style boolean values (True
orFalse
). Unfortunately, Rails doesn't coerce these into their respective boolean values; they both get treated as strings. You'll need to make sure you're sending all booleans astrue
orfalse
(lowercase) in order to trigger expected behavior from our API.You can actually find this and more helpful information on our API documentation page, which, thanks to our stellar employees and contributors is even available in Spanish if you're logged in and have your workspace set to Spanish.
Cheers, Anthony!
The text was updated successfully, but these errors were encountered: