go-swagger3
go-swagger3 copied to clipboard
Can not generate Request Param swagger config
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?
This happened to the Params which are objects in request
Hi @cuteQ thanks for the report, can you pass an example to replicate it?
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) { }