mattetti / Weasel-Diesel

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

Can this be used with rails? #20

Closed timuckun closed 11 years ago

timuckun commented 11 years ago

Is there a documentation anywhere on how to use this rails? I see a sample app on github but I don't see how the API is being routed at all. How do I specify the routes for the API?

mattetti commented 11 years ago

Some people have started looking into using the DSL with Rails but I haven't personally. An easy way would be to use wd_sinatra https://github.com/mattetti/wd-sinatra and to mount your app inside Rails. It would also have for benefit to let you easily extract it later on if needs be.

timuckun commented 11 years ago

Thanks for the quick reply.

Looking at the rails example app on github the author seems to be using it only for documentation. I think I might start with that approach.

Thanks again.

timuckun commented 11 years ago

BTW.

Is there a way to specify multiple actions /get /get/:id /post etc...

mattetti commented 11 years ago

are you asking if a specific endpoint can have multiple urls? Each service can only have one url endpoint, however, an endpoint can internally forward to another one.

timuckun commented 11 years ago

No what I meant was if there is a GET and a POST to the same URL but the functionality is different for the two methods.

mattetti commented 11 years ago

absolutely, these would be two different endpoints (2 different files), but the service verb would be different.

timuckun commented 11 years ago

Great Thanks.

BTW I was able to wire it up to rails but only as a documentation engine. I think that its very useful for this purpose.

mattetti commented 11 years ago

Cool, I really should take the time to look into how that's done, document it and show how to use the param verification as a before filter in Rails.