Open API schema validation returns an error with Content-Type=application/json; charset=utf-8

Issue #360 new
Former user created an issue

Open API schema validation function is supporting Content-Type=application/json, but the function returns an error when Content-Type=application/json; charset=utf-8 is passed to it.

Comments (2)

  1. beytullah çalışkan

    Hi,

    You may get an error if there is "application/json;charset#x3D;utf-8" in the api-docs.json file. Just update it with "application/json;charset=utf-8".

    br.

    Error Reason

    "400": {
      "description": "Bad Request",  "content": {
        "application/json;charset=utf-8": {
          "schema": {
            "$ref": "#/components/schemas/ApiExceptionResponse"      }
        }
      }
    }
    

    Solution:

    "400": {
      "description": "Bad Request",  "content": {
        "application/json;charset=UTF-8": {
          "schema": {
            "$ref": "#/components/schemas/ApiExceptionResponse"      }
        }
      }
    }
    

  2. Sravan Kumar Sandela

    It works for me, see no issue. with or without caps in utf, and with or without space after ; it works just fine.

  3. Log in to comment