dsfdsf21312 2018-09-26 10:21
浏览 25

如何将杜松子{proxy +}设置为杜松子酒和招摇的路径?

golang newb here ;)

I'm using gin, with an example API being:

// @Summary GET proxied request
// @Produce  json
// @Router /exampleapp/proxy/{proxy+} [get]
func getter(c *gin.Context) {
    handleRequest(c)
}

func main() {
    r := gin.Default()

    group := r.Group("/exampleapp")
    group.GET("/proxy/*path", getter)

    r.Run(":8088")
}

I am using swaggo/swag to generate a swagger file from the above annotations, I want it to output swagger.json like this:

"/exampleapp/proxy/{proxy+}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "summary": "GET proxied request"
            }
        }

but I can't get the + to escape correctly, currently getting

"/exampleapp/proxy/{proxy": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "summary": "GET proxied request"
            }
        }

Have tried variations of \\, \+ but can't quite get it. Whats the correct way to escape that +?

This is so I can use proxying on AWS APIGW

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?