-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
fix(goctl): Fix getting swagger consume types #4903
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files🚀 New features to boost your workflow:
|
f546b98
to
97c036f
Compare
structType, ok := tp.(spec.DefineStruct) | ||
if !ok { | ||
|
||
if tp == nil { |
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.
why not use original conditions?
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 have corrected it
97c036f
to
54d1ed5
Compare
tools/goctl/api/swagger/swagger.go
Outdated
if t.Key == tag { | ||
return true | ||
} | ||
func typeContainsTag(ctx Context, tp apiSpec.Type, tag string) bool { |
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.
func typeContainsTag(ctx Context, structType apiSpec.DefineStruct, tag string)
@@ -11,14 +11,16 @@ func consumesFromTypeOrDef(ctx Context, method string, tp spec.Type) []string { | |||
if strings.EqualFold(method, http.MethodGet) { | |||
return []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.
consumesFromTypeOrDef
this function need not changed.
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.
but expandMembers function need apiSpec.Type
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.
understand, I have corrected it
fix(goctl): Fix getting swagger consume types fix(goctl): Fix getting swagger consume types fix(goctl): Fix getting swagger consume types
54d1ed5
to
a923252
Compare
fix #4898