Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不支持生成OAS3的枚举类型 #328

Open
yieio opened this issue Jul 28, 2022 · 1 comment
Open

不支持生成OAS3的枚举类型 #328

yieio opened this issue Jul 28, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@yieio
Copy link

yieio commented Jul 28, 2022

What happens(发生了什么)?

RT,OAS3的OpenApi 枚举会生成成 Class类型

Pont 版本1.3.3

接口 json

{
  "openapi": "3.0.1",
  "info": {
    "title": "框架API",
    "version": "v1"
  },
  "paths":  {
  },
  "components": {
    "schemas": {
      "AjaxResultType": {
        "enum": [
          "Success",
          "Info",
          "UnAuth",
          "Forbidden",
          "NoFound",
          "Locked",
          "Error"
        ],
        "type": "string"
      }
    },
    "securitySchemes": {
      "oauth2": {
        "type": "apiKey",
        "description": "请输入带有Bearer的Token,形如 “Bearer {Token}” ",
        "name": "Authorization",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "oauth2": [
        "readAccess",
        "writeAccess"
      ]
    }
  ]
}

生成的baseClass内容:

class AjaxResultType {}

希望能生成

enum AjaxResultType {
   Success,
         Info = "Info",
        UnAuth =  "UnAuth",
        Forbidden =  "Forbidden",
        NoFound =  "NoFound",
        Locked =  "Locked",
        Error =  "Error"
}
@ianfuin
Copy link
Collaborator

ianfuin commented Oct 12, 2022

目前支持 swagger2和swagger3。
#339 这个mr已支持自定义解析数据源,等待合并后新版发布。

@z979054461 z979054461 added the enhancement New feature or request label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants