Skip to content

json tag中包含form会将请求参数转换为form表单而不是application/json格式 #100

@fiecato

Description

@fiecato

如果字段名字中带有form字符,会将json的tag错误识别,导致请求转为form提交

                         // if defineStruct, ok := route.RequestType.(spec.DefineStruct); ok {
			// 	for _, member := range defineStruct.Members {
			// 		if strings.Contains(member.Tag, "form") {
			// 			operationObject.Consumes = []string{"multipart/form-data"}
			// 			break
			// 		}
			// 	}
			// }

目前只能先注释掉该部分内容进行使用

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions