Receiving "Unable to parse JSON - Unrecognized character escape" on query string value with backslash

Issue #220 resolved
Jan Pradac (bredy) created an issue

Passing to query string parameter value (URI encoded), e.g. "F\p" and while processing this string in validator I get exception:

[ERROR][REQUEST][GET /objects @query.param] Unable to parse JSON - Unrecognized character escape 'p' (code 112) at [Source: (String)""F\p""; line: 1, column: 3].

Schema for this param is:

      parameters:
        - in: query
          name: param
          required: false
          schema:
              type: string
              minLength: 1
              maxLength: 20
              nullable: false

Expected behaviour:

  • param value is accepted without problems

Note:

  • exception is not thrown for specific backslash combination with specific meaning like "\b, \d, \n, \r, \t, etc." but probably theirs meaning is changed during parsing.

Comments (2)

  1. Log in to comment