You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2021/08/13 08:36:35 UTC

[GitHub] [servicecomb-java-chassis] chenchanglong1997 opened a new issue #2503: pojo类的属性定义@notblank ,controller 层使用@Validated注解

chenchanglong1997 opened a new issue #2503:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2503


   pojo类的属性定义@notblank 
   controller 层使用@Validated注解
   生成的契约,此属性为非必填项,没有生效。
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] chenchanglong1997 commented on issue #2503: pojo类的属性定义@notblank ,controller 层使用@Validated注解

Posted by GitBox <gi...@apache.org>.
chenchanglong1997 commented on issue #2503:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2503#issuecomment-899183610


   > “不生效” 的含义是什么?能给一个具体例子吗?
   
   public class Student {
       @NotBlank
       String name;
       @NotNull
       int age;
   }
       @RequestMapping(path = "/testNotBlank", method = RequestMethod.POST)
       public void testNotBlank(@Validated @RequestBody Student student) {
       }       使用@notnull是可以的,生成的swagger是必填属性,而notblank不行,并不是非必填属性


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] chenchanglong1997 commented on issue #2503: pojo类的属性定义@notblank ,controller 层使用@Validated注解

Posted by GitBox <gi...@apache.org>.
chenchanglong1997 commented on issue #2503:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2503#issuecomment-898346029


   controller 层方法参数使用@Valid注解也不生效


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] chenchanglong1997 commented on issue #2503: pojo类的属性定义@notblank ,controller 层使用@Validated注解

Posted by GitBox <gi...@apache.org>.
chenchanglong1997 commented on issue #2503:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2503#issuecomment-899182123


   > “不生效” 的含义是什么?能给一个具体例子吗?
   
   public class Student {
       @NotBlank
       String name;
       @NotNull
       int age;


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2503: pojo类的属性定义@notblank ,controller 层使用@Validated注解

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2503:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2503#issuecomment-899160302


   “不生效” 的含义是什么?能给一个具体例子吗?


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2503: pojo类的属性定义@notblank ,controller 层使用@Validated注解

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2503:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2503#issuecomment-899262781


   这块的内容属于 swagger api的实现范围。 应该大部分validation annotation都是支持的。 但是需要考虑swagger语义和validation annotation的语义的对应关系。 我没详细测试过, 可能 NotBlank 是不受支持的标签。 
   
   也可以检查下目前的swagger版本。 参考: https://stackoverflow.com/questions/37145656/configure-swagger-javax-validation-constraints-on-dtos
   
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] chenchanglong1997 closed issue #2503: pojo类的属性定义@notblank ,controller 层使用@Validated注解

Posted by GitBox <gi...@apache.org>.
chenchanglong1997 closed issue #2503:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2503


   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] chenchanglong1997 commented on issue #2503: pojo类的属性定义@notblank ,controller 层使用@Validated注解

Posted by GitBox <gi...@apache.org>.
chenchanglong1997 commented on issue #2503:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2503#issuecomment-899464998


   > 这块的内容属于 swagger api的实现范围。 应该大部分validation annotation都是支持的。 但是需要考虑swagger语义和validation annotation的语义的对应关系。 我没详细测试过, 可能 NotBlank 是不受支持的标签。
   > 
   > 也可以检查下目前的swagger版本。 参考: https://stackoverflow.com/questions/37145656/configure-swagger-javax-validation-constraints-on-dtos
   
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] chenchanglong1997 removed a comment on issue #2503: pojo类的属性定义@notblank ,controller 层使用@Validated注解

Posted by GitBox <gi...@apache.org>.
chenchanglong1997 removed a comment on issue #2503:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2503#issuecomment-899182240


   > “不生效” 的含义是什么?能给一个具体例子吗?
   
   public class Student {
       @NotBlank
       String name;
       @NotNull
       int age;


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] chenchanglong1997 commented on issue #2503: pojo类的属性定义@notblank ,controller 层使用@Validated注解

Posted by GitBox <gi...@apache.org>.
chenchanglong1997 commented on issue #2503:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2503#issuecomment-899182240


   > “不生效” 的含义是什么?能给一个具体例子吗?
   
   public class Student {
       @NotBlank
       String name;
       @NotNull
       int age;


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] chenchanglong1997 removed a comment on issue #2503: pojo类的属性定义@notblank ,controller 层使用@Validated注解

Posted by GitBox <gi...@apache.org>.
chenchanglong1997 removed a comment on issue #2503:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2503#issuecomment-899182123


   > “不生效” 的含义是什么?能给一个具体例子吗?
   
   public class Student {
       @NotBlank
       String name;
       @NotNull
       int age;


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org