adrian-gomez / swaggard

Add Swagger documentation to your Rails REST endpoints.
MIT License
54 stars 39 forks source link

Support status codes in @response_class #24

Closed ariejan closed 7 years ago

ariejan commented 7 years ago

The default 200 status code is retained. So

@response_class MyClass

still works as expected. When specifying a specific status code, simply separate it with whitespace from the class.

@response_class MyClass 201
adrian-gomez commented 7 years ago

@ariejan Thanks for your contribution!

What if instead of adding more stuff to @response_class we create a new tag? @response_code 201 so we dont pollute the one we already have?

Also on the same line we can create another new tag to address #23 @response_root ping_response by default it will be null (not used) but you can set it to anything you want.

Let me know if those sound like good ideas to you and if you want to work on them, otherwise I can go ahead and work on them

adrian-gomez commented 7 years ago

@ariejan In case you are still interested I'm closing this one as I have created #27, you can now do @response_status 201 in your controller to indicate the response status code