-
Notifications
You must be signed in to change notification settings - Fork 885
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
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 👍
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 |
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
.