Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature req: live swagger doc #2392

Open
pswenson opened this Issue Feb 2, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@pswenson
Copy link

pswenson commented Feb 2, 2017

IMO prometheus should have live/interactive swagger doc for the API ala: http://petstore.swagger.io

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jul 14, 2017

@fabxc Do we have this now?

@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented Feb 17, 2018

I have used swagger and I find it super useful.
It enforces consistent api structure and the online UI parser http://petstore.swagger.io can be used to test the api.

The current v2 protobuf file is used to auto-generated swagger definition swagger.json for the admin api so for v2 this would come out of the box(as long as you use the REST gateway, doesn't support grpc).

for v1 we would need to write the swagger definition which will generate the go skeleton and just need to implement each function. It would be a bit of work as it also enforces its own types.
It is a standardised so for long term api support might be worth the hassle.

I think it also handles api versioning quite well.

The only drawback I remember was that the auto-generated function names and data types tend to become rather long and difficult to edit without a proper IDE auto-completion support.

@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented Feb 17, 2018

btw it also autogenerates the docs for the api so it saves a ton of work there.
docker uses swagger for their api
all of this is auto generated form the swagger spec file - yaml
https://docs.docker.com/engine/api/v1.36/

@fkromer

This comment has been minimized.

Copy link

fkromer commented Apr 4, 2018

Would be great if one could auto generate clients for the Query HTTP API e.g. for Python with bravado. That would save tons of work as well 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.