[
https://issues.apache.org/jira/browse/SCB-904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16611431#comment-16611431
]
ASF GitHub Bot commented on SCB-904:
------------------------------------
wujimin commented on a change in pull request #902: [SCB-904] SpringMVC
@RequestHeader do not support value,only support name
URL:
https://github.com/apache/incubator-servicecomb-java-chassis/pull/902#discussion_r216871500
##########
File path:
swagger/swagger-generator/generator-springmvc/src/main/java/org/apache/servicecomb/swagger/generator/springmvc/processor/annotation/RequestHeaderAnnotationProcessor.java
##########
@@ -32,7 +32,11 @@ public HeaderParameter createParameter() {
@Override
public String getAnnotationParameterName(Object annotation) {
- return ((RequestHeader) annotation).name();
+ String name = ((RequestHeader) annotation).name();
+ if (name == null || name.isEmpty()) {
+ name = ((RequestHeader) annotation).value();
Review comment:
name will never be null
i'm not sure if it is good to use name() directly
in very early version, we add similar logic and then delete it
because in that time, some customer use old spring version, that not support
name() property.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> SpringMVC @RequestHeader do not support value,only support name
> ---------------------------------------------------------------
>
> Key: SCB-904
> URL: https://issues.apache.org/jira/browse/SCB-904
> Project: Apache ServiceComb
> Issue Type: Bug
> Components: Java-Chassis
> Reporter: WeiChao
> Assignee: WeiChao
> Priority: Major
> Fix For: java-chassis-1.1.0
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)