swagger-parser icon indicating copy to clipboard operation
swagger-parser copied to clipboard

[swagger-parser-v2-converter] not is converted part started with "schema" under path/<operation>/responses/<response_code> from OpenAPI v2 to OpenAPI v3

Open ltorok opened this issue 3 years ago • 0 comments

    "/REST_Resource_3": {
      "put": {
        "consumes": [
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json",
          "text/html"
        ],
        "parameters": [
          {
            "name": "parameter123",
            "in": "query",
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 2
          }
        ],
        "responses": {
          "201": {
            "description": "",
            "headers": {
              "X-Test-Parameter1": {
                "type": "string"
              }
            },
            "schema": {
              "properties": {
                "complex": {
                  "type": "object",
                  "properties": {
                    "string": {
                      "type": "string"
                    },
                    "integer": {
                      "type": "integer",
                      "format": "int32"
                    }
                  },
                  "required": ["string"]
                },
                "decimal": {
                  "type": "number",
                  "format": "double"
                }
              }
            }
          }
        }
      }
    },

Version of swagger-parser-v2-converter is 2.1.2.

Minimal completely sample (as .json swagger file) for example:

{
  "swagger": "2.0",
  "info": {
    "version": "1.0.0",
    "title": "REST_Api_1"
  },
  "paths": {
    "/REST_Resource_3": {
      "put": {
        "consumes": [
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "201": {
            "description": "schema is not converted",
            "schema": {
              "properties": {
                "complex": {
                  "type": "object",
                  "properties": {
                    "string": {
                      "type": "string"
                    },
                    "integer": {
                      "type": "integer",
                      "format": "int32"
                    }
                  },
                  "required": ["string"]
                },
                "decimal": {
                  "type": "number",
                  "format": "double"
                }
              }
            }
          }
        }
      }
    }
  }
}

ltorok avatar Sep 12 '22 10:09 ltorok