openapi2typescript icon indicating copy to clipboard operation
openapi2typescript copied to clipboard

建议类型解析能支持openapi 3.1协议

Open Alioth1017 opened this issue 2 years ago • 0 comments

目前发现 openapi 3.1 协议下,errorMessage字段类型定义会被解析成any

3.0 json片段

  "components": {
    "schemas": {
      "PageResponseResult": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "是否成功"
          },
          "errorMessage": {
            "type": "string",
            "description": "错误信息",
            "nullable": true
          }
        }
      }
    }
  }

3.1 json片段

  "components": {
    "schemas": {
      "PageResponseResult": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "是否成功"
          },
          "errorMessage": {
            "type": ["string", "null"],
            "description": "错误信息"
          }
        }
      }
    }
  }

Alioth1017 avatar Oct 18 '23 02:10 Alioth1017