Skip to content
This repository has been archived by the owner on Jul 30, 2023. It is now read-only.

The package go-restful-swagger12 does not display all operations in swagger.json #5

Open
azenakhi opened this issue Jun 25, 2017 · 6 comments

Comments

@azenakhi
Copy link

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

@OmidHekayati
Copy link

use this rule in version 1.2
$ curl http://localhost:8080/{SwaggerPath}/{path}/

in your case:
$ curl http://localhost:8080/swagger.json/users/

@azenakhi
Copy link
Author

Thanks. It works.
Can we use the 2.0 version of swagger ?

@OmidHekayati
Copy link

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": {}
}

@azenakhi azenakhi closed this as completed Jul 1, 2017
@azenakhi
Copy link
Author

azenakhi commented Jul 1, 2017

Thanks

@azenakhi azenakhi reopened this Jul 1, 2017
@vbondarev
Copy link

vbondarev commented Jul 6, 2017

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.

@vbondarev
Copy link

I tried to use go-restful-openapi and it works as I want ))))

gorexlv pushed a commit to gorexlv/go-restful-swagger20 that referenced this issue Aug 31, 2020
support describing response headers
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants