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

枚举问题 #58

Open
jhansin-zhang opened this issue Jan 7, 2021 · 1 comment
Open

枚举问题 #58

jhansin-zhang opened this issue Jan 7, 2021 · 1 comment

Comments

@jhansin-zhang
Copy link

你好大佬,目前想使用你得插件,遇到个问题,在@ApiResponse如何定义枚举型啊

  • "role": { "enum": "1|2|3", "type": "string","description": "角色" },是这样写嘛
@daodao97
Copy link
Owner

daodao97 commented Jan 7, 2021

@ApiResponse 只是定义了返回结果的样例, 如果返回结果, 如 性别, 可选值为 0, 1, 那么 response 将把性别字段, 转换为 integer, 为转换为 枚举

rule 中枚举的定义, 可以参考 laravel/validata/rule, 格式为 in:1,0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants