我在 Php Laravel 中编写 API 并使用 swagger (2.0) 注释(lib: darkaonline/l5-swagger使用swagger-php)来生成 swagger.json,但是我有以下问题 - 当我输入时:
/**
*
* Space Schema
*
* @SWG\Get(
* path="/api/v1/client/space/schema",
* @SWG\Response(
* response=200,
* description="OK",
* @SWG\Property(property="result", type="json", example={ "aa": [ "bb", "cc" ] } )
* )
* )
并尝试生成 swagger.json 我得到:
[Syntax Error] Expected PlainValue, got '[' in ...
但是当我不使用方括号时,例如:
@SWG\Property(property="result", type="json", example={ "ee": "ff" })
然后一切都很好。但是我需要使用方括号,所以问题是:
[
swagger注释中json字符串中(方括号)的转义字符是什么?
我还想补充一点,我的示例 json 很大很复杂