yhs0092 commented on issue #1460: 
org.apache.servicecomb.swagger.invocation.converter.ConverterMgr#findConverter时能否通过注解表明当前类和目标类结构相似无需转换
URL: 
https://github.com/apache/servicecomb-java-chassis/issues/1460#issuecomment-565697822
 
 
   Java-Chassis 1.x 
版本由于强类型内核机制的限定,要求框架内传递的参数类型和契约里面声明的参数类型一致(可以调试看看`org.apache.servicecomb.swagger.invocation.SwaggerInvocation#swaggerArguments`数组里面的东西),甚至在classpath里面找不着契约中声明的类型时,还会根据契约内容动态生成对应的Java参数类型。
   Java-Chassis 2.0 
版本将这一“强类型内核”机制改为了“弱类型内核”。如果classpath里面没有契约中`x-java-class`属性声明的参数类型时,在REST传输方式下,框架会依赖Jackson的能力对参数做反序列化,`Invocation#swaggerArguments`里面传输的不一定是对应的Java参数类型了,也有可能是`LinkedHashMap`、`String`之类的数据类型,这取决于你传递的数据码流以及Jackson的处理行为。
   如果你对这多的一次参数类型转换比较介意的话,建议关注一下Java-Chassis 2.0版本(当前在master分支上开发中),也许它能满足你的预期  
: )

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to