mattetti / Weasel-Diesel

DSL to describe, document and test web services
MIT License
438 stars 21 forks source link

Add support for optional namespaces #27

Closed kamui closed 11 years ago

kamui commented 11 years ago

This is a PR for #23. I couldn't attach this PR to that issue, so I had to create a new PR.

This is just my initial stab at it. I think my test coverage makes sense, but I don't actually need this feature, so it could definitely use a review by someone who does.

If this implementation makes sense, I'll update the documentation as well. In my implementation, I created a WeaselDiesel::Params::Namespace class that contains a name and options (currently, only a null attribute). I'm not entirely sure that the space_name attribute works to describe the params namespace now that it's more than just a string.

wd-sinatra will also probably need a patch so it can generate the correct documentation for this feature.

Let me know what you think.

FYI: Travis CI fails due to a top level array spec failing. This fails in master as well, so it shouldn't be caused by my branch.

mattetti commented 11 years ago

Thanks @kamui please do update the doc and wd-sinatra :)

kamui commented 11 years ago

I don't have commit access to WD, so here's my commit for documentation for optional namespaces:

https://github.com/kamui/Weasel-Diesel/commit/4b64a64e70c01c5859ae92aac1a6f3ca4b862624

I'm not sure this feature needs any explanation. Input params can have :null => true and it seems intuitive what this means, I'm assuming this is true for namespaces, so I just added an example of it to the README.

kamui commented 11 years ago

@mattetti Also, if you get a chance, can you cut a new version? I'd like to require that version in wd_sinatra since it'll depend on this new version of WD for the namespace class for doc gen.

mattetti commented 11 years ago

Will do and I will add you to the list of maintainers on rubygems. On Aug 22, 2013 5:02 PM, "Jack Chu" notifications@github.com wrote:

@mattetti https://github.com/mattetti Also, if you get a chance, can you cut a new version? I'd like to require that version in wd_sinatrasince it'll depend on this new version of WD for the namespace class for doc gen.

— Reply to this email directly or view it on GitHubhttps://github.com/mattetti/Weasel-Diesel/pull/27#issuecomment-23135345 .

kamui commented 11 years ago

:+1:

mattetti commented 11 years ago

Gem released, waiting for Jack's email address to add him as a gem owner.

On Thu, Aug 22, 2013 at 8:21 PM, Jack Chu notifications@github.com wrote:

[image: :+1:]

— Reply to this email directly or view it on GitHubhttps://github.com/mattetti/Weasel-Diesel/pull/27#issuecomment-23141196 .