-
-
Notifications
You must be signed in to change notification settings - Fork 371
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
Update swagger API specification #1782
Update swagger API specification #1782
Conversation
Drop former swagger code/references, because it was not working
Co-authored-by: qwerty287 <[email protected]>
Co-authored-by: qwerty287 <[email protected]>
Co-authored-by: qwerty287 <[email protected]>
Co-authored-by: qwerty287 <[email protected]>
…ration' into feature/swagger-ui-and-auto-generation
Deployment of preview was successful: https://woodpecker-ci-woodpecker-pr-1782.surge.sh |
…ration' into feature/swagger-ui-and-auto-generation
This comment was marked as outdated.
This comment was marked as outdated.
Co-authored-by: qwerty287 <[email protected]>
…ration' into feature/swagger-ui-and-auto-generation
… PR#1782; this api is supposed to be deleted with PR#1791
…-ui-and-auto-generation
…ration' into feature/swagger-ui-and-auto-generation
if you run -> either track it or remove it from git completly ... I'm for the first one |
Hi @6543 I'm sorry but I'm not fully getting what you mean. |
I checked out this branch and did run |
Now I got it, thanks for pointing out. That said, I anticipate, excluding the generated docs.go file from the git will prevent accidental inconsistencies in code, like you faced. Simply because I forgot to re-generate+commit the new swagger after deleting the file from the PR. Thanks for the feedback, will remove it with my next commit. |
… instead" This reverts commit 47bcf64.
@nitram509 I'll push some patches that will explain it better :) |
This is how I've added the redoc page: 4fba29c |
well beside all the experiments and some code comments i did added @nitram509 what I ment by "add a check": 52fdc38 |
so I expect the pipeline to fail now and then I'll commit a updated version and it should pass |
@nitram509 thanks for the work you put into it :) |
https://redocusaurus.vercel.app/ followup of #1782 --------- Co-authored-by: Anbraten <[email protected]>
Summary
#292
This PR drops the outdated former swagger.yaml/json and introduced automatic API document generation from Go code.
The generated code is also used to generate documentation/markdown for the community page,
as well as enable the Woodpecker server to serve a Swagger Web UI for manual tinkering.
I did opt-in for gin-swagger, a middleware for the Gin framework, to ease implementation and have a sophisticated output.
This middleware only produces Swagger v2 specs. AFAIK the newer OpenApi 3x tooling is not yet that mature,
so I guess that's fine for now.
Motivation
I was not able to find up-to-date API documentation, for my Woodpecker integration project.
There was some outdated swagger.json in the source repo, but that's very much outdated.
Having proper API documentation tremendously eases the integration and use of Woodpecker for all admins and developers.
Also, I was surprised and found a new un-documented feature (keyword: ccmenu) which is great and underpins, how important documentation is.
Implemenation notes
Areas of uncertainty
This is my first contribution to Woodpecker and I tried my best to align with your conventions.
That said, I found myself uncertain about these things and would be glad about getting feedback.
Visual examples
The API list is quite long, he're two screenshots.