Skip to content
This repository was archived by the owner on Sep 14, 2022. It is now read-only.

Fixes for REST Clients and Multiple HTTP Methods bound to the same Path #1

Merged
merged 1 commit into from
Aug 25, 2011

Conversation

jdpgrailsdev
Copy link

  • Added charset to content-type in response header to make it compatible with various REST clients (such s the Groovy RESTClient).
  • Added additional logging for case where a non-Swagger error is caught while executing a REST method.
  • Fixed issue with logic in addMethod that prevents two different HTTP methods not he same path from being
    registered (the original behavior violates REST). For instance, say you have the path /foo and want to register both the POST and DELETE HTTP methods on that path (which is correct for REST). Furthermore, lets assume the following Swagger calls:

swagger.addPost(app, ...);
swagger.addDelete(app, ...);

Only the POST will be added to the "app" instance, as the DELETE will get caught in that if check and only get appended to the API and NOT registered with "app". I am not sure what this logic was intended to do, so I am not sure that the fix is correct. However, it got me around the issue I was seeing.

* Added charset to content-type in response header to make it compatible
with various REST clients (such s the Groovy RESTClient). * Added
additional logging for case where a non-Swagger error is caught while
executing a REST method. * Fixed issue with logic in addMethod that
prevents two different HTTP methods not he same path from being
registered (the original behavior violates REST).
fehguy added a commit that referenced this pull request Aug 25, 2011
Fixes for REST Clients and Multiple HTTP Methods bound to the same Path
@fehguy fehguy merged commit 748ec0d into swagger-api:master Aug 25, 2011
@fehguy
Copy link
Contributor

fehguy commented Aug 25, 2011

thanks jdpgrailsdev!

@jdpgrailsdev
Copy link
Author

No problem. Again, I wasn't sure about what that if statement was trying to
achieve by matching duplicate paths. It just seems incorrect, but I am not
sure that adding the method to the check is the correct fix. Any plans to
turn the swagger.js file into a true Node.js module using NPM?

Thanks,

--Jonathan

On Thu, Aug 25, 2011 at 10:55 AM, fehguy <
reply@reply.github.com>wrote:

thanks jdpgrailsdev!

Reply to this email directly or view it on GitHub:
#1 (comment)

paulhill added a commit that referenced this pull request Aug 22, 2013
Error handler is now configurable, and can be bypassed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants