1

I get the response in the form of an associative array encoded in json, which contains 3 elements of the boolean, integer and string types.

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!"

This is what the answer looks like:

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

But I don't understand how to decode the msg element. Tips?

Verdant
  • 11
  • 3

1 Answers1

0

I found the answer. In the place where we return the encoded response, we need to add the constant JSON_UNESCAPED_UNICODE.

ouflak
  • 2,458
  • 10
  • 44
  • 49
Verdant
  • 11
  • 3