0

我以 json 编码的关联数组的形式获得响应,其中包含布尔、整数和字符串类型的 3 个元素。

responses:
        200:
          description: Success
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: object 
                    properties:
                     success:
                       type: boolean
                       example: true
                     code:
                       type: integer
                       example: 200
                     msg:
                       type: string
                       example: "Success!"

这就是答案的样子:

{"成功":true,"code":200,"msg":"\u0423\u0441\u043f\u0435\u0445!"}

但我不明白如何解码 msg 元素。提示?

4

1 回答 1

0

我找到了答案。在我们返回编码响应的地方,我们需要添加常量 JSON_UNESCAPED_UNICODE。

于 2021-08-30T07:26:32.447 回答