swagger-suite
swagger-suite copied to clipboard
"Try it out" in /docs for petstore returns 404 Not found
It appears that the request URI is not appended to the basePath. Note how the request does not include the /pets suffix.
Steps to reproduce:
- Install swagger-suite via npm / bower
- npm run petstore
- go to http://localhost:3000/docs/
- Attempt to get a list of pets using the /pets method
Request:
http://localhost:3000/api HTTP/1.1
Content-Type:
Response:
HTTP/1.1 404 Not Found
Date: Mon, 26 Jan 2015 23:09:32 GMT
Vary: 127.0.0.1
X-Powered-By: Swagger-Server Mock
Access-Control-Max-Age: 0
Access-Control-Allow-Methods: get, put, post, delete, options, head, patch
Content-Type: application/json; charset=utf-8
Access-Control-Allow-Origin: 127.0.0.1
Access-Control-Allow-Credentials: true
Connection: keep-alive
Access-Control-Allow-Headers:
Content-Length: 34
ETag: W/"22-918ae4c0"
{
"code": 404,
"message": "Not Found"
}
Just confirming shoudnt your request look like
http://localhost:3000/api/pets
Yes that's right. For some reason /pets isn't part of the URL...
hello, i tried the petstore. and click Try it out button to test on GET /pets, only get Response Body [] Response Code 200 Response Headers { "X-Powered-By": "Swagger-Server Mock", "Access-Control-Allow-Origin": "202.138.249.208", "Vary": "202.138.249.208", "Access-Control-Allow-Credentials": "true", "Access-Control-Max-Age": "0", "Access-Control-Allow-Methods": "GET, POST", "Content-Type": "application/json; charset=utf-8", "Content-Length": "2", "Etag": "W/"2-d4cbb29"", "Date": "Wed, 25 Feb 2015 02:35:25 GMT", "Connection": "keep-alive" } where is the pets?
I'm working feverishly on a new release of Swagger-Suite (and Swagger-Server, and Swagger-Parser, and Swagger-Express-Middleware) that will fix a ton of issues with the current 0.x version. I've written nearly 2000 unit tests, so I'm much more confident in the quality and stability of the new version. Expect it out in the next few weeks...
Great news! Thanks!
On Thu, Feb 26, 2015 at 4:35 AM, James Messinger [email protected] wrote:
I'm working feverishly on a new release of Swagger-Suite (and Swagger-Server, and Swagger-Parser, and Swagger-Express-Middleware) that will fix a ton of issues with the current 0.x version. I've written nearly 2000 unit tests, so I'm much more confident in the quality and stability of the new version. Expect it out in the next few weeks...
— Reply to this email directly or view it on GitHub https://github.com/BigstickCarpet/swagger-suite/issues/5#issuecomment-76085432 .
Just FYI - the new version is coming along nicely. The entire middleware layer is done now, and I've released it as a separate, standalone project (Swagger Express Middleware), complete with code samples and walkthroughs. Feel free to check it out and let me know what you think.
The goal of Swagger Express Middleware is to be a set of plug-and-play middleware modules that can be used in any Express app. Whereas Swagger Server goes a little further and actually extends Express with extra features that are specific to Swagger APIs.
awesome!
any news? :) BTW I think the path problem is part of swagger-ui or swagger-editor last release, I dowloaded it and I get the same behaviour
I'm making progress, but it's been slow-going for the past couple of weeks because I've been swamped working on other projects. Nonetheless, I've finished refactoring Swagger Server to use the new middleware layer, and I hope to work on it more this coming weekend.