go-restful-swagger12
go-restful-swagger12 copied to clipboard
The package go-restful-swagger12 does not display all operations in swagger.json
Hello,
I tried to test https://github.com/emicklei/go-restful/blob/master/examples/restful-user-resource.go, but go-restful-swagger12 does not display all operations ?
$ curl http://localhost:8080/swagger.json { "swaggerVersion": "1.2", "apis": [ { "path": "/users", "description": "Manage Users hello " } ], "apiVersion": "", "info": { "title": "", "description": "" } }
Thanks by advance. Best regards, Ahmed ZENAKHI
use this rule in version 1.2 $ curl http://localhost:8080/{SwaggerPath}/{path}/
in your case: $ curl http://localhost:8080/swagger.json/users/
Thanks. It works. Can we use the 2.0 version of swagger ?
Yes, Why not! in version 2 all document represent in one json in this url: $ curl http://{host}/{SwaggerPath}/ and you have a key for {path} inside that json. response Json template is like this:
{
"schemes": [],
"swagger": "2.0",
"info": {},
"host": "",
"paths": {}
}
Thanks
Hi. Great work, your project is very cool. I use it in my project some time. But now I need to use swagger of 2 version. In the previous answer you said it possible, but I don't understand how. Could you explain how I can do it.
I tried to use go-restful-openapi and it works as I want ))))