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 2022/12/08 07:23:54 UTC

[GitHub] [servicecomb-java-chassis] liubao68 commented on a diff in pull request #3513: [SCB-2737] export swagger contents to temporary files

liubao68 commented on code in PR #3513:
URL: https://github.com/apache/servicecomb-java-chassis/pull/3513#discussion_r1043008051


##########
core/src/main/java/org/apache/servicecomb/core/provider/producer/ProducerBootListener.java:
##########
@@ -44,9 +44,15 @@
 
 public class ProducerBootListener implements BootListener {
   private static final Logger LOGGER = LoggerFactory.getLogger(ProducerBootListener.class);
+  
+  private static final String pattern = "/%s/%s.yaml";
 
   @Override
   public void onAfterTransport(BootEvent event) {
+    boolean exportToFile = DynamicPropertyFactory.getInstance()
+            .getBooleanProperty(DefinitionConst.SWAGGER_EXPORT_ENABLED, false).get();
+    String filePath = DynamicPropertyFactory.getInstance()
+            .getStringProperty(DefinitionConst.SWAGGER_DIRECTORY, "/tmp/microservices").get() + pattern;

Review Comment:
   use system temporary directory `java.io.tmpdir `



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