Chilkat Online Tools

PureBasic / Postman API / Schema Security Validation

Back to Collection Items

IncludeFile "CkJsonObject.pb"
IncludeFile "CkStringBuilder.pb"
IncludeFile "CkHttp.pb"
IncludeFile "CkHttpResponse.pb"

Procedure ChilkatExample()

    ; This example assumes the Chilkat API to have been previously unlocked.
    ; See Global Unlock Sample for sample code.

    http.i = CkHttp::ckCreate()
    If http.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    success.i

    ; Use this online tool to generate code from sample JSON: Generate Code to Create JSON

    ; The following JSON is sent in the request body.

    ; {
    ;   "schema": {
    ;     "type": "openapi3",
    ;     "language": "json",
    ;     "schema": "{\"openapi\":\"3.0.0\",\"info\":{\"version\":\"1\",\"title\":\"temp\",\"license\":{\"name\":\"MIT\"}},\"servers\":[{\"url\":\"https://petstore.swagger.io/v1\"}],\"paths\":{\"/user\":{\"get\":{\"summary\":\"Details about a user\",\"operationId\":\"listUser\",\"tags\":[\"user\"],\"parameters\":[{\"name\":\"id\",\"in\":\"query\",\"description\":\"ID of the user\",\"required\":true,\"schema\":{\"type\":\"integer\",\"format\":\"int32\"}}],\"responses\":{\"200\":{\"description\":\"Details about a user\",\"headers\":{\"x-next\":{\"description\":\"A link to the next page of responses\",\"schema\":{\"type\":\"string\"}}},\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/User\"}}}},\"default\":{\"description\":\"unexpected error\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Error\"}}}}}}}},\"components\":{\"schemas\":{\"User\":{\"type\":\"object\",\"required\":[\"id\",\"name\"],\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}}},\"Error\":{\"type\":\"object\",\"required\":[\"code\",\"message\"],\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\"},\"message\":{\"type\":\"string\"}}}},\"securitySchemes\":{\"BasicAuth\":{\"type\":\"http\",\"scheme\":\"basic\"}}},\"security\":[{\"BasicAuth\":[]}]}"
    ;   }
    ; }

    json.i = CkJsonObject::ckCreate()
    If json.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    CkJsonObject::ckUpdateString(json,"schema.type","openapi3")
    CkJsonObject::ckUpdateString(json,"schema.language","json")
    CkJsonObject::ckUpdateString(json,"schema.schema","{" + Chr(34) + "openapi" + Chr(34) + ":" + Chr(34) + "3.0.0" + Chr(34) + "," + Chr(34) + "info" + Chr(34) + ":{" + Chr(34) + "version" + Chr(34) + ":" + Chr(34) + "1" + Chr(34) + "," + Chr(34) + "title" + Chr(34) + ":" + Chr(34) + "temp" + Chr(34) + "," + Chr(34) + "license" + Chr(34) + ":{" + Chr(34) + "name" + Chr(34) + ":" + Chr(34) + "MIT" + Chr(34) + "}}," + Chr(34) + "servers" + Chr(34) + ":[{" + Chr(34) + "url" + Chr(34) + ":" + Chr(34) + "https://petstore.swagger.io/v1" + Chr(34) + "}]," + Chr(34) + "paths" + Chr(34) + ":{" + Chr(34) + "/user" + Chr(34) + ":{" + Chr(34) + "get" + Chr(34) + ":{" + Chr(34) + "summary" + Chr(34) + ":" + Chr(34) + "Details about a user" + Chr(34) + "," + Chr(34) + "operationId" + Chr(34) + ":" + Chr(34) + "listUser" + Chr(34) + "," + Chr(34) + "tags" + Chr(34) + ":[" + Chr(34) + "user" + Chr(34) + "]," + Chr(34) + "parameters" + Chr(34) + ":[{" + Chr(34) + "name" + Chr(34) + ":" + Chr(34) + "id" + Chr(34) + "," + Chr(34) + "in" + Chr(34) + ":" + Chr(34) + "query" + Chr(34) + "," + Chr(34) + "description" + Chr(34) + ":" + Chr(34) + "ID of the user" + Chr(34) + "," + Chr(34) + "required" + Chr(34) + ":true," + Chr(34) + "schema" + Chr(34) + ":{" + Chr(34) + "type" + Chr(34) + ":" + Chr(34) + "integer" + Chr(34) + "," + Chr(34) + "format" + Chr(34) + ":" + Chr(34) + "int32" + Chr(34) + "}}]," + Chr(34) + "responses" + Chr(34) + ":{" + Chr(34) + "200" + Chr(34) + ":{" + Chr(34) + "description" + Chr(34) + ":" + Chr(34) + "Details about a user" + Chr(34) + "," + Chr(34) + "headers" + Chr(34) + ":{" + Chr(34) + "x-next" + Chr(34) + ":{" + Chr(34) + "description" + Chr(34) + ":" + Chr(34) + "A link to the next page of responses" + Chr(34) + "," + Chr(34) + "schema" + Chr(34) + ":{" + Chr(34) + "type" + Chr(34) + ":" + Chr(34) + "string" + Chr(34) + "}}}," + Chr(34) + "content" + Chr(34) + ":{" + Chr(34) + "application/json" + Chr(34) + ":{" + Chr(34) + "schema" + Chr(34) + ":{" + Chr(34) + "$ref" + Chr(34) + ":" + Chr(34) + "#/components/schemas/User" + Chr(34) + "}}}}," + Chr(34) + "default" + Chr(34) + ":{" + Chr(34) + "description" + Chr(34) + ":" + Chr(34) + "unexpected error" + Chr(34) + "," + Chr(34) + "content" + Chr(34) + ":{" + Chr(34) + "application/json" + Chr(34) + ":{" + Chr(34) + "schema" + Chr(34) + ":{" + Chr(34) + "$ref" + Chr(34) + ":" + Chr(34) + "#/components/schemas/Error" + Chr(34) + "}}}}}}}}," + Chr(34) + "components" + Chr(34) + ":{" + Chr(34) + "schemas" + Chr(34) + ":{" + Chr(34) + "User" + Chr(34) + ":{" + Chr(34) + "type" + Chr(34) + ":" + Chr(34) + "object" + Chr(34) + "," + Chr(34) + "required" + Chr(34) + ":[" + Chr(34) + "id" + Chr(34) + "," + Chr(34) + "name" + Chr(34) + "]," + Chr(34) + "properties" + Chr(34) + ":{" + Chr(34) + "id" + Chr(34) + ":{" + Chr(34) + "type" + Chr(34) + ":" + Chr(34) + "integer" + Chr(34) + "," + Chr(34) + "format" + Chr(34) + ":" + Chr(34) + "int64" + Chr(34) + "}," + Chr(34) + "name" + Chr(34) + ":{" + Chr(34) + "type" + Chr(34) + ":" + Chr(34) + "string" + Chr(34) + "}," + Chr(34) + "tag" + Chr(34) + ":{" + Chr(34) + "type" + Chr(34) + ":" + Chr(34) + "string" + Chr(34) + "}}}," + Chr(34) + "Error" + Chr(34) + ":{" + Chr(34) + "type" + Chr(34) + ":" + Chr(34) + "object" + Chr(34) + "," + Chr(34) + "required" + Chr(34) + ":[" + Chr(34) + "code" + Chr(34) + "," + Chr(34) + "message" + Chr(34) + "]," + Chr(34) + "properties" + Chr(34) + ":{" + Chr(34) + "code" + Chr(34) + ":{" + Chr(34) + "type" + Chr(34) + ":" + Chr(34) + "integer" + Chr(34) + "," + Chr(34) + "format" + Chr(34) + ":" + Chr(34) + "int32" + Chr(34) + "}," + Chr(34) + "message" + Chr(34) + ":{" + Chr(34) + "type" + Chr(34) + ":" + Chr(34) + "string" + Chr(34) + "}}}}," + Chr(34) + "securitySchemes" + Chr(34) + ":{" + Chr(34) + "BasicAuth" + Chr(34) + ":{" + Chr(34) + "type" + Chr(34) + ":" + Chr(34) + "http" + Chr(34) + "," + Chr(34) + "scheme" + Chr(34) + ":" + Chr(34) + "basic" + Chr(34) + "}}}," + Chr(34) + "security" + Chr(34) + ":[{" + Chr(34) + "BasicAuth" + Chr(34) + ":[]}]}")

    CkHttp::ckSetRequestHeader(http,"Content-Type","application/json")
    CkHttp::ckSetRequestHeader(http,"X-API-Key","{{postman_api_key}}")

    resp.i = CkHttp::ckPostJson3(http,"https://api.getpostman.com/security/api-validation","application/json",json)
    If CkHttp::ckLastMethodSuccess(http) = 0
        Debug CkHttp::ckLastErrorText(http)
        CkHttp::ckDispose(http)
        CkJsonObject::ckDispose(json)
        ProcedureReturn
    EndIf

    sbResponseBody.i = CkStringBuilder::ckCreate()
    If sbResponseBody.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    CkHttpResponse::ckGetBodySb(resp,sbResponseBody)

    jResp.i = CkJsonObject::ckCreate()
    If jResp.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    CkJsonObject::ckLoadSb(jResp,sbResponseBody)
    CkJsonObject::setCkEmitCompact(jResp, 0)

    Debug "Response Body:"
    Debug CkJsonObject::ckEmit(jResp)

    respStatusCode.i = CkHttpResponse::ckStatusCode(resp)
    Debug "Response Status Code = " + Str(respStatusCode)
    If respStatusCode >= 400
        Debug "Response Header:"
        Debug CkHttpResponse::ckHeader(resp)
        Debug "Failed."
        CkHttpResponse::ckDispose(resp)

        CkHttp::ckDispose(http)
        CkJsonObject::ckDispose(json)
        CkStringBuilder::ckDispose(sbResponseBody)
        CkJsonObject::ckDispose(jResp)
        ProcedureReturn
    EndIf

    CkHttpResponse::ckDispose(resp)

    ; Sample JSON response:
    ; (Sample code for parsing the JSON response is shown below)

    ; {
    ;   "warnings": [
    ;     {
    ;       "severity": "MEDIUM",
    ;       "message": "HTTP authentication scheme is using an unknown scheme.",
    ;       "location": {
    ;         "start": {
    ;           "line": 1,
    ;           "column": 1116
    ;         },
    ;         "end": {
    ;           "line": 1,
    ;           "column": 1118
    ;         }
    ;       },
    ;       "dataPath": [
    ;         "components",
    ;         "securitySchemes",
    ;         "BasicAuth",
    ;         "scheme"
    ;       ],
    ;       "possibleFixUrl": "https://go.pstmn.io/security-warnings#http-authentication-scheme-is-using-an-unknown-scheme"
    ;     }
    ;   ]
    ; }

    ; Sample code for parsing the JSON response...
    ; Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code

    severity.s
    message.s
    Line.i
    Column.i
    EndLine.i
    EndColumn.i
    possibleFixUrl.s
    j.i
    count_j.i
    strVal.s

    i.i = 0
    count_i.i = CkJsonObject::ckSizeOfArray(jResp,"warnings")
    While i < count_i
        CkJsonObject::setCkI(jResp, i)
        severity = CkJsonObject::ckStringOf(jResp,"warnings[i].severity")
        message = CkJsonObject::ckStringOf(jResp,"warnings[i].message")
        Line = CkJsonObject::ckIntOf(jResp,"warnings[i].location.start.line")
        Column = CkJsonObject::ckIntOf(jResp,"warnings[i].location.start.column")
        EndLine = CkJsonObject::ckIntOf(jResp,"warnings[i].location.end.line")
        EndColumn = CkJsonObject::ckIntOf(jResp,"warnings[i].location.end.column")
        possibleFixUrl = CkJsonObject::ckStringOf(jResp,"warnings[i].possibleFixUrl")
        j = 0
        count_j = CkJsonObject::ckSizeOfArray(jResp,"warnings[i].dataPath")
        While j < count_j
            CkJsonObject::setCkJ(jResp, j)
            strVal = CkJsonObject::ckStringOf(jResp,"warnings[i].dataPath[j]")
            j = j + 1
        Wend
        i = i + 1
    Wend


    CkHttp::ckDispose(http)
    CkJsonObject::ckDispose(json)
    CkStringBuilder::ckDispose(sbResponseBody)
    CkJsonObject::ckDispose(jResp)


    ProcedureReturn
EndProcedure

Curl Command

curl -X POST
	-H "X-API-Key: {{postman_api_key}}"
	-H "Content-Type: application/json"
	-d '{
    "schema": {
        "type": "openapi3",
        "language": "json",
        "schema": "{\"openapi\":\"3.0.0\",\"info\":{\"version\":\"1\",\"title\":\"temp\",\"license\":{\"name\":\"MIT\"}},\"servers\":[{\"url\":\"https://petstore.swagger.io/v1\"}],\"paths\":{\"/user\":{\"get\":{\"summary\":\"Details about a user\",\"operationId\":\"listUser\",\"tags\":[\"user\"],\"parameters\":[{\"name\":\"id\",\"in\":\"query\",\"description\":\"ID of the user\",\"required\":true,\"schema\":{\"type\":\"integer\",\"format\":\"int32\"}}],\"responses\":{\"200\":{\"description\":\"Details about a user\",\"headers\":{\"x-next\":{\"description\":\"A link to the next page of responses\",\"schema\":{\"type\":\"string\"}}},\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/User\"}}}},\"default\":{\"description\":\"unexpected error\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Error\"}}}}}}}},\"components\":{\"schemas\":{\"User\":{\"type\":\"object\",\"required\":[\"id\",\"name\"],\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}}},\"Error\":{\"type\":\"object\",\"required\":[\"code\",\"message\"],\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\"},\"message\":{\"type\":\"string\"}}}},\"securitySchemes\":{\"BasicAuth\":{\"type\":\"http\",\"scheme\":\"basic\"}}},\"security\":[{\"BasicAuth\":[]}]}"
    }
}'
https://api.getpostman.com/security/api-validation

Postman Collection Item JSON

{
  "name": "Schema Security Validation",
  "request": {
    "method": "POST",
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n    \"schema\": {\n        \"type\": \"openapi3\",\n        \"language\": \"json\",\n        \"schema\": \"{\\\"openapi\\\":\\\"3.0.0\\\",\\\"info\\\":{\\\"version\\\":\\\"1\\\",\\\"title\\\":\\\"temp\\\",\\\"license\\\":{\\\"name\\\":\\\"MIT\\\"}},\\\"servers\\\":[{\\\"url\\\":\\\"https://petstore.swagger.io/v1\\\"}],\\\"paths\\\":{\\\"/user\\\":{\\\"get\\\":{\\\"summary\\\":\\\"Details about a user\\\",\\\"operationId\\\":\\\"listUser\\\",\\\"tags\\\":[\\\"user\\\"],\\\"parameters\\\":[{\\\"name\\\":\\\"id\\\",\\\"in\\\":\\\"query\\\",\\\"description\\\":\\\"ID of the user\\\",\\\"required\\\":true,\\\"schema\\\":{\\\"type\\\":\\\"integer\\\",\\\"format\\\":\\\"int32\\\"}}],\\\"responses\\\":{\\\"200\\\":{\\\"description\\\":\\\"Details about a user\\\",\\\"headers\\\":{\\\"x-next\\\":{\\\"description\\\":\\\"A link to the next page of responses\\\",\\\"schema\\\":{\\\"type\\\":\\\"string\\\"}}},\\\"content\\\":{\\\"application/json\\\":{\\\"schema\\\":{\\\"$ref\\\":\\\"#/components/schemas/User\\\"}}}},\\\"default\\\":{\\\"description\\\":\\\"unexpected error\\\",\\\"content\\\":{\\\"application/json\\\":{\\\"schema\\\":{\\\"$ref\\\":\\\"#/components/schemas/Error\\\"}}}}}}}},\\\"components\\\":{\\\"schemas\\\":{\\\"User\\\":{\\\"type\\\":\\\"object\\\",\\\"required\\\":[\\\"id\\\",\\\"name\\\"],\\\"properties\\\":{\\\"id\\\":{\\\"type\\\":\\\"integer\\\",\\\"format\\\":\\\"int64\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"tag\\\":{\\\"type\\\":\\\"string\\\"}}},\\\"Error\\\":{\\\"type\\\":\\\"object\\\",\\\"required\\\":[\\\"code\\\",\\\"message\\\"],\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"format\\\":\\\"int32\\\"},\\\"message\\\":{\\\"type\\\":\\\"string\\\"}}}},\\\"securitySchemes\\\":{\\\"BasicAuth\\\":{\\\"type\\\":\\\"http\\\",\\\"scheme\\\":\\\"basic\\\"}}},\\\"security\\\":[{\\\"BasicAuth\\\":[]}]}\"\n    }\n}"
    },
    "url": {
      "raw": "https://api.getpostman.com/security/api-validation",
      "protocol": "https",
      "host": [
        "api",
        "getpostman",
        "com"
      ],
      "path": [
        "security",
        "api-validation"
      ]
    },
    "description": "This endpoint will perform **static analysis** on the **Schema specification**. It will return the security misses in your schema definition and help you understand their implications and possible ways to patch the warnings. You can introduce this endpoint to your CI/CD process to automate your schema validation.\n\n**Request Body**(max size 10MB)</br>\n\n| Key | Value Type | Required | Description |\n| ---- |----| --- | ---- |\n| type | Enum(openapi3, openapi2) | Yes | Type of Schema Specification |\n| language | Enum(json, yaml) | Yes | Format of Schema Specification |\n| schema | String | Yes | Stringified Schema Body|\n\nVisit [Learning Center](https://learning.postman-beta.com/docs/api-security/security-warnings/security-warnings-overview) for more information"
  },
  "response": [
    {
      "name": "Successful Response with Warnings",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "name": "Content-Type",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"schema\": {\n        \"type\": \"openapi3\",\n        \"language\": \"json\",\n        \"schema\": \"{\\\"openapi\\\":\\\"3.0.0\\\",\\\"info\\\":{\\\"version\\\":\\\"1\\\",\\\"title\\\":\\\"temp\\\",\\\"license\\\":{\\\"name\\\":\\\"MIT\\\"}},\\\"servers\\\":[{\\\"url\\\":\\\"https://petstore.swagger.io/v1\\\"}],\\\"paths\\\":{\\\"/user\\\":{\\\"get\\\":{\\\"summary\\\":\\\"Details about a user\\\",\\\"operationId\\\":\\\"listUser\\\",\\\"tags\\\":[\\\"user\\\"],\\\"parameters\\\":[{\\\"name\\\":\\\"id\\\",\\\"in\\\":\\\"query\\\",\\\"description\\\":\\\"ID of the user\\\",\\\"required\\\":true,\\\"schema\\\":{\\\"type\\\":\\\"integer\\\",\\\"format\\\":\\\"int32\\\"}}],\\\"responses\\\":{\\\"200\\\":{\\\"description\\\":\\\"Details about a user\\\",\\\"headers\\\":{\\\"x-next\\\":{\\\"description\\\":\\\"A link to the next page of responses\\\",\\\"schema\\\":{\\\"type\\\":\\\"string\\\"}}},\\\"content\\\":{\\\"application/json\\\":{\\\"schema\\\":{\\\"$ref\\\":\\\"#/components/schemas/User\\\"}}}},\\\"default\\\":{\\\"description\\\":\\\"unexpected error\\\",\\\"content\\\":{\\\"application/json\\\":{\\\"schema\\\":{\\\"$ref\\\":\\\"#/components/schemas/Error\\\"}}}}}}}},\\\"components\\\":{\\\"schemas\\\":{\\\"User\\\":{\\\"type\\\":\\\"object\\\",\\\"required\\\":[\\\"id\\\",\\\"name\\\"],\\\"properties\\\":{\\\"id\\\":{\\\"type\\\":\\\"integer\\\",\\\"format\\\":\\\"int64\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"tag\\\":{\\\"type\\\":\\\"string\\\"}}},\\\"Error\\\":{\\\"type\\\":\\\"object\\\",\\\"required\\\":[\\\"code\\\",\\\"message\\\"],\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"format\\\":\\\"int32\\\"},\\\"message\\\":{\\\"type\\\":\\\"string\\\"}}}},\\\"securitySchemes\\\":{\\\"BasicAuth\\\":{\\\"type\\\":\\\"http\\\",\\\"scheme\\\":\\\"\\\"}}},\\\"security\\\":[{\\\"BasicAuth\\\":[]}]}\"\n    }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://api.getpostman.com/security/api-validation",
          "protocol": "https",
          "host": [
            "api",
            "getpostman",
            "com"
          ],
          "path": [
            "security",
            "api-validation"
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Date",
          "value": "Sun, 12 Sep 2021 09:45:42 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json; charset=utf-8"
        },
        {
          "key": "Transfer-Encoding",
          "value": "chunked"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "Server",
          "value": "nginx"
        },
        {
          "key": "x-frame-options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "Access-Control-Allow-Origin",
          "value": "*"
        },
        {
          "key": "x-srv-trace",
          "value": "v=1;t=df3a673f51ba400d"
        },
        {
          "key": "x-srv-span",
          "value": "v=1;s=5f5d0aa04106e973"
        },
        {
          "key": "X-RateLimit-Limit",
          "value": "60"
        },
        {
          "key": "X-RateLimit-Remaining",
          "value": "58"
        },
        {
          "key": "X-RateLimit-Reset",
          "value": "1631439948"
        },
        {
          "key": "ETag",
          "value": "W/\"164-PBgIpGM9qzmFyny6Y8Rw7l8wfv4\""
        },
        {
          "key": "Vary",
          "value": "Accept-Encoding"
        },
        {
          "key": "Content-Encoding",
          "value": "gzip"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"warnings\": [\n        {\n            \"severity\": \"MEDIUM\",\n            \"message\": \"HTTP authentication scheme is using an unknown scheme.\",\n            \"location\": {\n                \"start\": {\n                    \"line\": 1,\n                    \"column\": 1116\n                },\n                \"end\": {\n                    \"line\": 1,\n                    \"column\": 1118\n                }\n            },\n            \"dataPath\": [\n                \"components\",\n                \"securitySchemes\",\n                \"BasicAuth\",\n                \"scheme\"\n            ],\n            \"possibleFixUrl\": \"https://go.pstmn.io/security-warnings#http-authentication-scheme-is-using-an-unknown-scheme\"\n        }\n    ]\n}"
    },
    {
      "name": "No Warnings Found",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "name": "Content-Type",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"schema\": {\n        \"type\": \"openapi3\",\n        \"language\": \"json\",\n        \"schema\": \"{\\\"openapi\\\":\\\"3.0.0\\\",\\\"info\\\":{\\\"version\\\":\\\"1\\\",\\\"title\\\":\\\"temp\\\",\\\"license\\\":{\\\"name\\\":\\\"MIT\\\"}},\\\"servers\\\":[{\\\"url\\\":\\\"https://petstore.swagger.io/v1\\\"}],\\\"paths\\\":{\\\"/user\\\":{\\\"get\\\":{\\\"summary\\\":\\\"Details about a user\\\",\\\"operationId\\\":\\\"listUser\\\",\\\"tags\\\":[\\\"user\\\"],\\\"parameters\\\":[{\\\"name\\\":\\\"id\\\",\\\"in\\\":\\\"query\\\",\\\"description\\\":\\\"ID of the user\\\",\\\"required\\\":true,\\\"schema\\\":{\\\"type\\\":\\\"integer\\\",\\\"format\\\":\\\"int32\\\"}}],\\\"responses\\\":{\\\"200\\\":{\\\"description\\\":\\\"Details about a user\\\",\\\"headers\\\":{\\\"x-next\\\":{\\\"description\\\":\\\"A link to the next page of responses\\\",\\\"schema\\\":{\\\"type\\\":\\\"string\\\"}}},\\\"content\\\":{\\\"application/json\\\":{\\\"schema\\\":{\\\"$ref\\\":\\\"#/components/schemas/User\\\"}}}},\\\"default\\\":{\\\"description\\\":\\\"unexpected error\\\",\\\"content\\\":{\\\"application/json\\\":{\\\"schema\\\":{\\\"$ref\\\":\\\"#/components/schemas/Error\\\"}}}}}}}},\\\"components\\\":{\\\"schemas\\\":{\\\"User\\\":{\\\"type\\\":\\\"object\\\",\\\"required\\\":[\\\"id\\\",\\\"name\\\"],\\\"properties\\\":{\\\"id\\\":{\\\"type\\\":\\\"integer\\\",\\\"format\\\":\\\"int64\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"tag\\\":{\\\"type\\\":\\\"string\\\"}}},\\\"Error\\\":{\\\"type\\\":\\\"object\\\",\\\"required\\\":[\\\"code\\\",\\\"message\\\"],\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"format\\\":\\\"int32\\\"},\\\"message\\\":{\\\"type\\\":\\\"string\\\"}}}},\\\"securitySchemes\\\":{\\\"BasicAuth\\\":{\\\"type\\\":\\\"http\\\",\\\"scheme\\\":\\\"basic\\\"}}},\\\"security\\\":[{\\\"BasicAuth\\\":[]}]}\"\n    }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://api.getpostman.com/security/api-validation",
          "protocol": "https",
          "host": [
            "api",
            "getpostman",
            "com"
          ],
          "path": [
            "security",
            "api-validation"
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Date",
          "value": "Sun, 12 Sep 2021 09:44:49 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json; charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "15"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "Server",
          "value": "nginx"
        },
        {
          "key": "x-frame-options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "Access-Control-Allow-Origin",
          "value": "*"
        },
        {
          "key": "x-srv-trace",
          "value": "v=1;t=ae1633478c228dbd"
        },
        {
          "key": "x-srv-span",
          "value": "v=1;s=6da9fbb5ccd53a5e"
        },
        {
          "key": "X-RateLimit-Limit",
          "value": "60"
        },
        {
          "key": "X-RateLimit-Remaining",
          "value": "59"
        },
        {
          "key": "X-RateLimit-Reset",
          "value": "1631439948"
        },
        {
          "key": "ETag",
          "value": "W/\"f-qOnA/C9SOc9LcVJFceEQk4jhluk\""
        },
        {
          "key": "Vary",
          "value": "Accept-Encoding"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"warnings\": []\n}"
    },
    {
      "name": "Empty Schema",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "name": "Content-Type",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"schema\": {\n        \"type\": \"openapi3\",\n        \"language\": \"yaml\",\n        \"schema\": \"\"\n    }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://api.getpostman.com/security/api-validation",
          "protocol": "https",
          "host": [
            "api",
            "getpostman",
            "com"
          ],
          "path": [
            "security",
            "api-validation"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Date",
          "value": "Sun, 12 Sep 2021 09:37:14 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json; charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "76"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "Server",
          "value": "nginx"
        },
        {
          "key": "x-frame-options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "Access-Control-Allow-Origin",
          "value": "*"
        },
        {
          "key": "x-srv-trace",
          "value": "v=1;t=55da76a33cc1385a"
        },
        {
          "key": "x-srv-span",
          "value": "v=1;s=b480f819d1813f77"
        },
        {
          "key": "X-RateLimit-Limit",
          "value": "60"
        },
        {
          "key": "X-RateLimit-Remaining",
          "value": "59"
        },
        {
          "key": "X-RateLimit-Reset",
          "value": "1631439494"
        },
        {
          "key": "ETag",
          "value": "W/\"4c-TSELlt/qtA+fU4WkV/YJz9BXr8w\""
        },
        {
          "key": "Vary",
          "value": "Accept-Encoding"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"error\": {\n        \"name\": \"Invalid Schema\",\n        \"message\": \"Empty input schema provided.\"\n    }\n}"
    },
    {
      "name": "Invalid Schema",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "name": "Content-Type",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"schemaType\": \"openapi3\",\n    \"schemaFormat\": \"json\",\n    \"schemaBody\": \"{}\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://api.getpostman.com/security/api-validation",
          "protocol": "https",
          "host": [
            "api",
            "getpostman",
            "com"
          ],
          "path": [
            "security",
            "api-validation"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Date",
          "value": "Sun, 12 Sep 2021 09:39:21 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json; charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "125"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "Server",
          "value": "nginx"
        },
        {
          "key": "x-frame-options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "Access-Control-Allow-Origin",
          "value": "*"
        },
        {
          "key": "x-srv-trace",
          "value": "v=1;t=583cc629de922167"
        },
        {
          "key": "x-srv-span",
          "value": "v=1;s=510c7b003e356f45"
        },
        {
          "key": "X-RateLimit-Limit",
          "value": "60"
        },
        {
          "key": "X-RateLimit-Remaining",
          "value": "59"
        },
        {
          "key": "X-RateLimit-Reset",
          "value": "1631439621"
        },
        {
          "key": "ETag",
          "value": "W/\"7d-N5PP6H8rafi0mv9sTvRw40PwI84\""
        },
        {
          "key": "Vary",
          "value": "Accept-Encoding"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"error\": {\n        \"name\": \"Invalid Schema\",\n        \"message\": \"Specification must contain a semantic version number of the OAS specification\"\n    }\n}"
    },
    {
      "name": "Not Supported Schema Type",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "name": "Content-Type",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"schema\": {\n        \"type\": \"openapi1\",\n        \"language\": \"json\",\n        \"schema\": \"{}\"\n    }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://api.getpostman.com/security/api-validation",
          "protocol": "https",
          "host": [
            "api",
            "getpostman",
            "com"
          ],
          "path": [
            "security",
            "api-validation"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Date",
          "value": "Sun, 12 Sep 2021 09:48:20 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json; charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "86"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "Server",
          "value": "nginx"
        },
        {
          "key": "x-frame-options",
          "value": "SAMEORIGIN"
        },
        {
          "key": "Access-Control-Allow-Origin",
          "value": "*"
        },
        {
          "key": "x-srv-trace",
          "value": "v=1;t=46038119474e3066"
        },
        {
          "key": "x-srv-span",
          "value": "v=1;s=df8409a0c765902c"
        },
        {
          "key": "X-RateLimit-Limit",
          "value": "60"
        },
        {
          "key": "X-RateLimit-Remaining",
          "value": "58"
        },
        {
          "key": "X-RateLimit-Reset",
          "value": "1631440148"
        },
        {
          "key": "ETag",
          "value": "W/\"56-LEdSx+qhB9qIEg40VOkfozFCTHk\""
        },
        {
          "key": "Vary",
          "value": "Accept-Encoding"
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"error\": {\n        \"name\": \"Invalid schema\",\n        \"message\": \"Provided schema type is not supported.\"\n    }\n}"
    },
    {
      "name": "Payload Too Large",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "name": "Content-Type",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"schema\": {\n        \"type\": \"openapi3\",\n        \"language\": \"yaml\",\n        \"schema\": {{largePayload}}\n    }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "https://api.getpostman.com/security/api-validation",
          "protocol": "https",
          "host": [
            "api",
            "getpostman",
            "com"
          ],
          "path": [
            "security",
            "api-validation"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Date",
          "value": "Sun, 12 Sep 2021 09:42:51 GMT"
        },
        {
          "key": "Content-Type",
          "value": "application/json; charset=utf-8"
        },
        {
          "key": "Content-Length",
          "value": "78"
        },
        {
          "key": "Connection",
          "value": "keep-alive"
        },
        {
          "key": "Server",
          "value": "nginx"
        },
        {
          "key": "ETag",
          "value": "W/\"4e-E4wtB3VEF/jim4+F3i6dVca260E\""
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"error\": {\n        \"name\": \"PayloadTooLargeError\",\n        \"message\": \"request entity too large\"\n    }\n}"
    }
  ]
}