go-swagger3 icon indicating copy to clipboard operation
go-swagger3 copied to clipboard

Can not generate Request Param swagger config

Open cuteQ opened this issue 2 years ago • 5 comments

In Param config, if we pass {in} as query, path, it won't generate Request Param Config in oas.yml. It also doesn't have {required} information in the oas.yml. Does someone know how to generate it or it's a bug?

cuteQ avatar Sep 18 '23 23:09 cuteQ

This happened to the Params which are objects in request

cuteQ avatar Sep 19 '23 00:09 cuteQ

Hi @cuteQ thanks for the report, can you pass an example to replicate it?

qequ avatar Oct 09 '23 19:10 qequ

Yes, when the Params is an object, then this request params won't be generated:

type SwaggerTestRequestSchema struct { AppId string query:"app_id,required" }

type SwaggerTestResponseSchema struct { ResponseMessage string json:"response_message,omitempty" }

// @Title Get hello world information // @Description Description content // @ID user-info // @Param swaggerRequest query SwaggerTestRequestSchema true "SwaggerTestRequestSchema JSON" // @Success 200 object SwaggerTestResponseSchema "SwaggerTestResponseSchema JSON" // @Failure 500 object SwaggerTestResponseSchema "SwaggerTestResponseSchema JSON" // @Router /open_api/v1.3/swagger/test/ [post] func SwaggerTestViewHandler(ctx context.Context, reqCtx *app.RequestContext) { }

cuteQ avatar Jan 11 '24 22:01 cuteQ