[ 
https://issues.apache.org/jira/browse/SCB-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16574180#comment-16574180
 ] 

ASF GitHub Bot commented on SCB-736:
------------------------------------

liubao68 commented on a change in pull request #863: [SCB-736] generate default 
value to swagger for primitive type when there is no defaultValue annotation
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/863#discussion_r208785710
 
 

 ##########
 File path: 
demo/demo-springmvc/springmvc-server/src/main/java/org/apache/servicecomb/demo/springmvc/server/SpringMvcDefaultValues.java
 ##########
 @@ -64,4 +64,28 @@ public String query3(@RequestParam("a") @Min(value = 20) 
int a, @RequestParam("b
     return "Hello " + a + b;
   }
 
+  @PostMapping("/javaprimitive1")
+  public String springJavaPrim1(@RequestParam(name = "a") int a,
 
 Review comment:
   From this demo and I made some tests, It seems for SpringMVC, there is a 
bug. 
   For @RequestParam and other annotations, they got a required attribute, and 
default value is true. It seems that when generating swagger, we do not 
consider this attribute and it is always false. Event we write 
@RequestParam(name="a", requrired=true). Can you check that?

----------------------------------------------------------------
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:
us...@infra.apache.org


> generate default value to swagger for primitive type, even there is no 
> defaultValue annotation
> ----------------------------------------------------------------------------------------------
>
>                 Key: SCB-736
>                 URL: https://issues.apache.org/jira/browse/SCB-736
>             Project: Apache ServiceComb
>          Issue Type: Task
>          Components: Java-Chassis
>            Reporter: wujimin
>            Assignee: Mahesh Raju Somalaraju
>            Priority: Major
>
> {code:java}
> @GetMapping(path = "test")
> public String test(int i,  boolean b) {
>   return "" + i + b;
> }
> {code}
> request without any query parameter should be ok
> must include all primitive types.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to