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 2020/09/09 09:39:45 UTC

[GitHub] [servicecomb-java-chassis] merryzsp opened a new issue #1946: org.apache.servicecomb.swagger.generator.core.setBasePath如何支持placeHolder?新版本设计上有变动么?

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


   老版本实现
   ![image](https://user-images.githubusercontent.com/44560672/92582150-2b773a80-f2c3-11ea-88d7-9789df81834b.png)
   新版本实现
   ![image](https://user-images.githubusercontent.com/44560672/92582190-38942980-f2c3-11ea-8da4-e7fecc370ab1.png)
   
   新版本basePath = (new PlaceholderResolver()).replaceFirst(basePath);
   这里没有正确处理Spring的PropertiesPlaceHolder  
   ![image](https://user-images.githubusercontent.com/44560672/92582278-56618e80-f2c3-11ea-98cd-82d3b07fc0bf.png)
   可以看到  placeHolder没有替换成功
   而老版本的是可以的   是新版本调整了PlaceHolder的使用方式么?


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



[GitHub] [servicecomb-java-chassis] merryzsp commented on issue #1946: org.apache.servicecomb.swagger.generator.core.setBasePath如何支持placeHolder?新版本设计上有变动么?

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


   > 应该是配置不在servicecomb加载范围内
   > 放microservice.yaml即可
   > org.apache.servicecomb.swagger.generator.core.TestSwaggerGenerator#testBasePathPlaceHolder,这个特性有自动用例验证的
   
   有两个问题哈:
   1、低版本的支持这个能力的,从产品的长期发展来看,应该尽量兼容早期版本的能力,支持spring的配置文件这个能力又不是什么坏事,为什么要去掉呢?
   2、从生态上来说,RequestMapping是SpringMvc的注解,它的使用不应该受限于某一个SC契约提取的方式,我觉得写到microservice.yaml的方式并不好,一来是适配的改动较大,二来是接受spring配置文件的能力不是更灵活么
   


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



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1946: org.apache.servicecomb.swagger.generator.core.setBasePath如何支持placeHolder?新版本设计上有变动么?

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


   写了一个类似的测试用例,支持将配置项的值写到spring boot的配置文件中: https://github.com/apache/servicecomb-java-chassis/pull/2251
   
   问题中的例子使用的是spring老版本的,并且PropertyPlaceholderConfigurer已经废弃。 所以不再提供这个用法的测试。 
   


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



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1946: org.apache.servicecomb.swagger.generator.core.setBasePath如何支持placeHolder?新版本设计上有变动么?

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


   问题关闭。 可以基于最新的java chassis版本和spring版本使用。 有问题重新提交issue。 


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



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1946: org.apache.servicecomb.swagger.generator.core.setBasePath如何支持placeHolder?新版本设计上有变动么?

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


   你能提供下使用场景吗? 可能是 bug。 看了下合入记录,这个修改已经很久了, 在重构的时候新增的。 


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



[GitHub] [servicecomb-java-chassis] liubao68 closed issue #1946: org.apache.servicecomb.swagger.generator.core.setBasePath如何支持placeHolder?新版本设计上有变动么?

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


   


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



[GitHub] [servicecomb-java-chassis] merryzsp commented on issue #1946: org.apache.servicecomb.swagger.generator.core.setBasePath如何支持placeHolder?新版本设计上有变动么?

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


   > 你能提供下使用场景吗? 可能是 bug。 看了下合入记录,这个修改已经很久了, 在重构的时候新增的。
   
   可以看我的demo里面的demo-consumer工程(附件里面)
   [demo.zip](https://github.com/apache/servicecomb-java-chassis/files/5194466/demo.zip)
   
   场景说明:
   1、controller使用@RequestMapping(path = "${context.v1}", produces = MediaType.APPLICATION_JSON)
   2、resources/conf/app.properties里面配置context.v1=/consumer/v1
   3、META-INF/spring/spring.consumer.bean.xml里面配置basePropertyPlaceholderConfigurer扫描classpath:conf/app.properties


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



[GitHub] [servicecomb-java-chassis] wujimin commented on issue #1946: org.apache.servicecomb.swagger.generator.core.setBasePath如何支持placeHolder?新版本设计上有变动么?

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


   应该是配置不在servicecomb加载范围内  
   放microservice.yaml即可  
   org.apache.servicecomb.swagger.generator.core.TestSwaggerGenerator#testBasePathPlaceHolder,这个特性有自动用例验证的


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