Support for nested parameter names #9

Open
adammeghji opened this Issue Oct 30, 2011 · 23 comments

Comments

Projects
None yet

Hello,

It seems that iodocs uses "querystring", which decided to not support nested parameter keys (i.e. deep objects) in 0.3:
https://github.com/joyent/node/wiki/Migrating-from-v0.2-to-v0.3

This means that Rails-style parameter names are no longer supported. i.e.:

In iodocs, that would be configured something like this:


A fix is to require('qs') instead of require('querystring'), which re-introduces support for deep objects. The "node-querystring" project can be found here:
https://github.com/visionmedia/node-querystring

If others would also find this valuable, perhaps support for nested objects could be introduced in iodocs.

Thanks!
Adam

I am interested in support for nested parameters.

To be more specific: I am looking for iodocs to support generating more advanced JSON request bodies. So, not just listing attributes as Rails does foo[bar] but entire JSON objects or array of objects as parameters... Now that I think of it, that's out of the scope of what was original described.

Contributor

mansilladev commented Aug 30, 2012

Take a look @ http://iodocs.docusign.com -- they've forked I/O Docs (not public yet) and added arrays, objects, dynamic addition/removal of array items. That would be a great way to start off this discussion.

More specifically, check out the resource "Request Signature" and the method "From Document".

dgc-wh commented Aug 30, 2012

I'm working on similar things on my branch: https://github.com/dgc-wh/iodocs
currently I just allow for arbitrary content, but on my local branch I have preliminary support for json-schema. I don't know how to reflect the schema in the iodocs interface though.

Did the docusign iodocs become public? That nested object field type is exactly what I need!

Contributor

mansilladev commented Sep 26, 2012

@lornajane Not yet. Last time I pinged @vladcretu (DocuSign) he said he needed a bit more time based on some other fantastic feature additions. He did show me some of the things that he was working on, including loading optimizations and alternative views, in addition to even more improvements on the objects/arrays.

It just seems a bit of a shame to duplicate it all, they've done a nice job. My use case is that I've started to add a bit of a github API description (I use IODocs to teach APIs with, it beats curl for those who aren't used to command line) - but almost everything needs nested arrays of data. You can see the beginnings here: http://lornajane-iodocs.herokuapp.com/github.

I thought it would simple to just add some gists - but even those are nested, so although I modified my iodocs to be able to post JSON rather than form data, I am still stuck!

Hi Neil/Lorna -

Neil: After TechCrunch Hackathon… we had the TechCrunch conference and DreamForce; and I was on the floor most of the time. Didn't make progress on IODocs but.. now I'm back in a normal work mode. I'll aim at having a finished and tested product early to mid next week.

Thanks,
Vlad

On Sep 26, 2012, at 6:02 AM, Lorna Jane Mitchell <notifications@github.commailto:notifications@github.com>
wrote:

It just seems a bit of a shame to duplicate it all, they've done a nice job. My use case is that I've started to add a bit of a github API description (I use IODocs to teach APIs with, it beats curl for those who aren't used to command line) - but almost everything needs nested arrays of data. You can see the beginnings here: http://lornajane-iodocs.herokuapp.com/github.

I thought it would simple to just add some gists - but even those are nested, so although I modified my iodocs to be able to post JSON rather than form data, I am still stuck!


Reply to this email directly or view it on GitHubhttps://github.com/mashery/iodocs/issues/9#issuecomment-8888897.

dgc-wh commented Sep 26, 2012

So, I also like the docusign improvements, and I was also working on my own project to add JSON support. Currently I just have an extra textarea that lets you type in a JSON datastructure and does some simple validation, and I'm working on adding JSON schema support for further validation, but the expandable objects and arrays is a nicer interface.

Really I'd much rather contribute to the docusign fork than reproduce it.

oh, my branch is here: https://github.com/dgc-wh/iodocs/tree/add-json-schema-validation

I will take a look at your branch - I could do with a textarea for just longer-than-a-textbox text fields but I wasn't sure how to make one of those. Thanks for sharing :)

I've added json support and initial array support on my branch - https://github.com/perrfekto/iodocs.git

Is there any update on the DocuSign Fork? I really could use the array/sub-object additions.

stou commented Dec 18, 2012

For what it is worth.

I have added basic support for array query parameters for my own needs, please pull it in or improve it if you find it useful.

https://github.com/stou/iodocs

Thanks for sharing this useful tool :-)

ajringg commented Jan 3, 2013

Hi @vladcretu,

My team and I think iodocs is the best solution among available interactive API documentation tools that we've found, but we're also hampered by the limitation of not having nested JSON objects in the requests.

I'd be interested to hear what progress you've made since your last reply, and if you plan on making the code public. Even if it is still unfinished or not completely tested, we'd like to take a look as this is pretty valuable stuff.

Thanks!

dgc-wh commented Jan 3, 2013

I have a simple workaround for this problem in my fork (just present a text box you can type arbitrary content into):
https://github.com/dgc-wh/iodocs

I'm working (slowly) on implementing input validation with json-schema (JSV), but I feel like there ought to be a better way of presenting the format to the user.

On Jan 2, 2013, at 6:54 PM, ajringg wrote:

Hi @vladcretu,

My team and I think iodocs is the best solution among available interactive API documentation tools that we've found, but we're also hampered by the limitation of not having nested JSON objects in the requests.

I'd be interested to hear what progress you've made since your last reply, and if you plan on making the code public. Even if it is still unfinished or not completely tested, we'd like to take a look as this is pretty valuable stuff.

Thanks!


Reply to this email directly or view it on GitHub.

For another reference, Updox has implemented nested object and array support:

http://updoxqa.com/iodox/updox-iodox

It just required adding a new parameter type, handling that type in the UI (e.g. add and remove buttons and rows), and a switch from querystring to qs.

Contributor

switzer commented Sep 7, 2013

Hi - I also would like to pass in more complex JSON to my REST API. There are a few different forks of iodocs that accomplish this - the only one which is open is the fork by @dgc-wh (which is pretty good!). Do you have plans to include the ability to pass arrays of objects? Should I start using this fork?

@vladcretu are you going to make your modifications to iodocs public?

Many Thanks!

dgc-wh commented Sep 7, 2013

@switzer Yes, I currenlty am working with @vky on a private branch and have arrays (and several other features) nearly ready to push back to github.

The updox branch looks pretty good too, and perhaps has a prettier skin, though it seems to have some rendering issues adding list items...

Contributor

switzer commented Sep 8, 2013

@dgc-wh I am looking forward to it! If you would like a beta user, I am happy to help. Please keep me posted when it is going back to github (or add me to your private branch????)

Cheers...

Contributor

vky commented Sep 9, 2013

@switzer Try out @dgc-wh's fork, https://github.com/dgc-wh/iodocs, it has nested parameters currently implemented (see https://github.com/dgc-wh/iodocs#put-and-post-content-body for an example of how to set them up). That version is a bit old, but it's got the core functionality in place. We'll have updates with the latest changes from Mashery's master soon.

@dgc-wh what rendering issues have you seen on the Updox branch?

Contributor

vky commented Sep 9, 2013

@rickhanlonii Here's an example of the rendering issue I'm seeing (using Firefox Aurora 25.0a2 (2013-09-06) on OS X):

Initial state: http://i.imgur.com/sdZoTW9.png
After clicking 'add' for 'to' parameter: http://i.imgur.com/OJiJlD8.png

@vkorapaty Oh yeah, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment