我正在使用这个库。我想在我的网址中有一个可选参数
例如我有这条路线
$app->get('/files/{order:\d+}[/{all:0|1|all}]', 'myctroller');
我的注释是
/**
* @SWG\Get(path="/doc/v1/files/{id_ordine}/{all}",
* tags={"GETFILE"},
* produces={"application/json"},
* @SWG\Parameter(
* name="order",
* in="path",
* type="integer",
* required=true,
* default="123",
* ),
* @SWG\Parameter(
* name="all",
* in="path",
* type="string",
* enum={"0","1","all"},
* default="all",
* required=false,
* ),
* @SWG\Response(response="200", description=xxx"),
* @SWG\Response(response="404", xxx")
* )
*/
使用 Chrome 和这个插件,我可以用我的文档做 CURL。如果我选择所有值为 0 我的卷曲就像
http://localhost/doc/v1/files/123/{all}
我想要一个像
http://localhost/doc/v1/files/123