-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
fix(swagger): operation id should use handler with group but not route doc first #4872
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
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files🚀 New features to boost your workflow:
|
| Security: security, | ||
| Parameters: parametersFromType(ctx, route.Method, route.RequestType), | ||
| Responses: jsonResponseFromType(ctx, route.AtDoc, route.ResponseType), | ||
| ID: getStringFromKVOrDefault(route.AtDoc.Properties, propertyKeyOperationId, getFirstUsableString(func() string { |
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.
Use the following code instead
groupName := getStringFromKVOrDefault(group.Annotation.Properties, propertyKeyGroup, "")
operationId := route.Handler
if len(groupName) > 0 {
operationId = stringx.From(groupName + "_" + route.Handler).ToCamel()
}
operationId = stringx.From(operationId).Untitle()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.
OK, I see you have made changes in your branch, so I won't commit.
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.
Can we resolve this conversation?
|
close with: #4890 |
e.g.
but not doc