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

参数多类型支持 #39

Open
seasidesun opened this issue Jul 25, 2019 · 0 comments
Open

参数多类型支持 #39

seasidesun opened this issue Jul 25, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@seasidesun
Copy link

seasidesun commented Jul 25, 2019

你的功能请求是否与某些问题相关?请描述
当某个api的参数过多时,如果只有一个参数是需要对象控制的,那要把所有的参数都改写成对象,这样有点不友好,改动成本有点高

描述您想要的解决方案
能不能两者都支持,类似这样:

[ 
  'userId',
  'date',
  {
    'status':  '0',
  },
  {
    'foo': 1,
  },
  {
    'bar': { required: true },
  }
]

当数组中的对象类型的参数中有多个 key 时,直接抛出错误。

[ 
  'userId',
  {
    'foo': 1,
    'bar': { required: true },
  }
]

描述你考虑过的备选方案
简洁清晰地描述一下你考虑过的其他备选方案,可能会有什么问题。

数组中的对象类型的参数有多个 key,这种方案灵活度太高,容易出问题。

附加上下文
添加一些问题的相关上下文。

@seasidesun seasidesun added the enhancement New feature or request label Jul 25, 2019
@seasidesun seasidesun changed the title feat: your feature... 参数多类型支持 Jul 25, 2019
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

2 participants