---------------------------------------------------------------------------------
踩坑过程:
①webapi的某action参数中,其中一个参数无意中使用了 “nodeName ”这个名字。
踩坑过程:
①webapi的某action参数中,其中一个参数无意中使用了 “nodeName ”这个名字。

②swagger前台调用该接口的时候,前台报JS异常错误,始终不好,如下。

报错信息为 Uncaught TypeError: r.nodeName.toLowerCase is not a function
![技术分享图片]()
----------------------------------------------------------------------------------
解决办法:
换参数名称,即把 nodeName 改为 其他适宜名称,哪怕改改大小写成为 NodeName。
----------------------------------------------------------------------------------
解决办法:
换参数名称,即把 nodeName 改为 其他适宜名称,哪怕改改大小写成为 NodeName。

修改后在从前台调用,就成功得到响应了。

----------------------------------------------------------------------------------
原因分析:nodeName 是html DOM的属性关键字,而swagger对此没有特殊对应。
----------------------------------------------------------------------------------
坑深程度:很浅
这个坑是swagger的,对WebApi本身没有影响,就是不改参数名称,接口一样正常运作。
----------------------------------------------------------------------------------
完毕