首页 \ 问答 \ 使用camelCase的Swagger UI问题(Swagger UI issue with camelCase)

使用camelCase的Swagger UI问题(Swagger UI issue with camelCase)

如果查询参数是camelCase格式,我将遇到问题。

例如: http:// localhost:9000 / api / hello?personName = test

此格式不适用于Swagger UI。 Swagger无法拾取camelCase中定义的任何参数。 它显示错误“缺少必需的参数:presonName”。

在此处输入图像描述

希望现在很清楚。

添加一个错误的屏幕截图

在此处输入图像描述

谢谢


I am facing problem with the query parameters if they are in camelCase format.

for ex : http://localhost:9000/api/hello?personName=test

This format doesnt work with the Swagger UI. Swagger is not able to pickup any parameter defined in camelCase. It shows error "missing required params: presonName".

enter image description here

Hope this is clear now.

Adding one more screen shot with error

enter image description here

thanks


原文:https://stackoverflow.com/questions/32248036
更新时间:2021-12-23 13:12

最满意答案

我会做miahabdu写的,但然后在控制器中的方法中添加验证。 仅仅因为用户无法看到链接,他仍然可以使用编辑/更新/删除URL。 隐藏链接只是化妆品。 就像是:

    if question.user == current_user do
        .....do stuff

如果没有返回一些禁止的flash消息,说明他们只能编辑,更新,删除自己的消息。

希望能帮助到你! 请不要隐藏链接,因为它无助于保护用户数据。


I would do what miahabdu wrote but then add validation to the methods in the controller. Just because a user can't see a link he could still just use the edit/update/delete URL. Just hiding links is only cosmetics. Something like:

    if question.user == current_user do
        .....do stuff

If not return some forbidden flash message explaining that they can only edit,update,delete their own message.

Hope it helps! Please don't just hide links as it does not help to secure user data.

相关问答

更多
  • 目前,没有在TFS 2017 Update2中通过Web门户编辑/删除 Git标签的功能。 它不受支持。 我在这里提交了一个用户语音来推荐该功能,你可以去投票以实现它。 作为一种解决方法,正如您在上面提到的,您可以使用Git Bash覆盖标记。 我可以重现这个问题: "A Git ref with the name already exists" 您有两种方法可以解决这个问题: 1.做一个强制推动 例如:标签名称是v1.4 git tag v1.4 v1.4 -f -m "Andy082 ...
  • 没有。 您可以使用您的设备上已经需要更新的应用程序来测试它。 确保你已经在你可以见证的应用程序中做了一些事情,更新它,关闭互联网以确保它没有从服务器获取信息并检查数据是否消失。 例如,这可以通过游戏进行水平进展。 No. You could test it with an app you have on your device already that needs updating. Make sure you've done something in an app you can witness, upd ...
  • NSUserDefaults * myNSUserDefaults = [NSUserDefaults standardUserDefaults]; NSDictionary * dict = [myNSUserDefaults dictionaryRepresentation]; for (id key in dict) { //heck the keys if u need [myNSUserDefaults removeObjectForKey:key]; } [myNSUser ...
  • 目前, before_action :correct_user, only: [:edit, :update]阻止管理员进入编辑页面。 修改correct_user方法以更改此行为: # Confirms the correct user. def correct_user @user = User.find(params[:id]) redirect_to(root_url) unless current_user?(@user) || current_user.admin? ...
  • SQL查询错误地构建。 更新SQL查询应如下所示 UPDATE table_name SET column1=value1,column2=value2,... WHERE some_column=some_value; 你的更新: UPDATE create_branch SET branch="'.$bn.'" , description="'.$d.'" WHERE Sl_no="'.$sn.'" SQL查询 - 删除: DELETE ...
  • 在CloudKit中,无法在1个查询中查询2个不同的记录类型。 唯一的例外是您已经知道特定的RecordId。 然后你可以查询那些ID。 因此,在您的情况下,当您还不了解用户时,您必须执行2次查询才能获得国家/地区记录。 您可以限制提取次数,因为您可能只有有限数量的国家/地区。 在应用启动时,只需查询所有国家/地区并将其保存在内存中,然后当您查询用户时,可以从内存中获取国家/地区。 如果您怀疑自己的国家/地区数据会频繁更改,请创建订阅,以便获得更新内存数据的通知。 如果您的记录中有参考列表,则查询该记录,从 ...
  • 最近,我为一家保险公司实施了一个白标电子商务系统,允许每个合作伙伴选择他们自己的一组输入字段,屏幕,并订购应用程序的流程以满足他们的个人需求。 虽然这不是火箭科学,但增加了复杂性并增加了开发时间。 仔细考虑用户配置方面事后看来,我的客户和他们的客户反过来会对更严格的系统感到满意。 至于你的问题的技术方面,我在VS2005中开发了我的项目,使用asp.net webforms和带有SQLserver后台的webservices,因此你所看到的堆栈绝对能够提供工作产品。 就可测试性而言,ASP.net MVC几 ...
  • 我会做miahabdu写的,但然后在控制器中的方法中添加验证。 仅仅因为用户无法看到链接,他仍然可以使用编辑/更新/删除URL。 隐藏链接只是化妆品。 就像是: if question.user == current_user do .....do stuff 如果没有返回一些禁止的flash消息,说明他们只能编辑,更新,删除自己的消息。 希望能帮助到你! 请不要隐藏链接,因为它无助于保护用户数据。 I would do what miahabdu wrote but then a ...
  • 我不得不添加'范围'。 这很有效。 sign_in :user, @user, bypass: true # for some reason Devise signs the user out 请在此处查看答案: https : //stackoverflow.com/a/11589286/148844 I had to add a 'scope`. This worked. sign_in :user, @user, bypass: true # for some reason Devise signs ...
  • 总的来说,我不确定你提出的具体问题,所以我正在尽力回答这些问题。 我希望这有帮助。 如果我错过了你的问题,我会澄清 - 请告诉我。 命令可用性/验证 : 我不确定你对这部分的问题是什么,但基本上你的用户行为会驱动你可用的命令。 命令对于该特定用户是否有效可以由提交命令的UI控制器(或任何机制)处理,或者可以由接收命令的域处理。 该命令应包含足够的信息以供域评估,然后更改其状态并引发事件。 抵制需求变化 : 如果实体发生变化,并非所有相关的读取模型都需要更改 - 它实际上取决于读取模型的目的。 维护读模型的一 ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。