Fix POST JSON parameter determination logic (goctl api swagger) & Add some unit test. (#4997)

Co-authored-by: XiaobinChen <xiaobin.chen@corerain.com>
This commit is contained in:
Twilikiss
2025-07-13 11:07:35 +08:00
committed by GitHub
parent ba0febf308
commit 8cf4f95bd7
2 changed files with 92 additions and 1 deletions

View File

@@ -9,7 +9,7 @@ import (
)
func isPostJson(ctx Context, method string, tp apiSpec.Type) (string, bool) {
if strings.EqualFold(method, http.MethodPost) {
if !strings.EqualFold(method, http.MethodPost) {
return "", false
}
structType, ok := tp.(apiSpec.DefineStruct)