- Notifications
You must be signed in to change notification settings - Fork928
feat: Validate swagger definitions#5694
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I haven't gone through the generated docs with a fine-toothed comb, but I just had a couple of questions/observations about the Swagger parser.
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is pretty neat 👍
Emyrk commentedJan 13, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Love how easily the go parser was to get comment groups. I would suggest we should comment what each assertion does. Some are obvious, but it would be helpful to have some english.
Do you intend to dig into the functions and seeing if the return type is called via |
Uh oh!
There was an error while loading.Please reload this page.
Fixes:#3522
This PR concludes the autogenerating docs initiative with a basic Swagger validator and custom rules, that will let us keep the better quality of docs. The validator uses
go/ast
to parse comments and Go structure fields. It covers OSS and Enterprisechi
handlers.Checks:
@Summary
and@ID
.@Success
and/or@Failure
.@...
@Security
tag is present.@Accept
annotation.@Produce
annotation.uuid.UUID
andtime.Time
fields are formatted.To reviewer:
coderdtest/swaggerparser.go
.