openapi-spec-validator icon indicating copy to clipboard operation
openapi-spec-validator copied to clipboard

Unescaped DELETE control character U+007F fails with "unacceptable character"

Open ultinate opened this issue 5 years ago • 0 comments

Note: I am not entirely sure if the source of this issue lies within the scope of this library of any of its dependencies.

Situation

My (openAPI specification) JSON file contains a string with an unescaped DELETE control character, U+007F.

"examples" : {
              "image/png" : ""  # should be U+007F (Github seems to redact this character)
            },

Output of python -m openapi_spec_validator --schema 2.0 openapi-spec.json is:

unacceptable character #x007f: special characters are not allowed
  in "<urllib response>", position 1082

If we replace the character by its encoded equivalent, like this:

"examples" : {
              "image/png" : "\u007f"
            },

the result is: OK

Expected

In my understanding, ~~RFC 7159 (obsolete)~~ RFC 8259 allows this specific control character to appear escaped and unescaped inside JSON strings: https://tools.ietf.org/html/rfc8259#section-7.

Therefore, I expect OK for both Inputs mentioned above.

ultinate avatar Jan 27 '20 10:01 ultinate