File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
modules/swagger-generator/src/main/java/io/swagger/v3/generator/online Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 17
17
import io .swagger .v3 .core .util .Json ;
18
18
import io .swagger .v3 .parser .util .ClasspathHelper ;
19
19
import io .swagger .v3 .parser .util .RemoteUrl ;
20
+ import jdk .javadoc .internal .doclets .formats .html .SourceToHTMLConverter ;
21
+
20
22
import org .apache .commons .io .FileUtils ;
21
23
import org .apache .commons .lang3 .StringUtils ;
22
24
import org .slf4j .Logger ;
31
33
import java .nio .file .Files ;
32
34
import java .nio .file .Path ;
33
35
import java .nio .file .Paths ;
36
+ import java .security .Security ;
34
37
import java .util .ArrayList ;
35
38
import java .util .Arrays ;
36
39
import java .util .Collections ;
@@ -53,9 +56,11 @@ public class GeneratorController {
53
56
private static String PROP_HIDDEN_OPTIONS = "HIDDEN_OPTIONS" ;
54
57
55
58
static {
56
- // allow writing files only to directories configgured via generatorWriteDirs sys prop
57
- // e.g. -DgeneratorWriteDirs="/tmp"
58
59
System .setSecurityManager (new FileAccessSecurityManager ());
60
+ // Enabling a SecurityManager disables DNS cache expiration. This can cause issues
61
+ // for long-running instances of swagger-generator when the IP addresses of referenced
62
+ // domains change.
63
+ Security .setProperty ("networkaddress.cache.ttl" , "60" );
59
64
60
65
hiddenOptions = loadHiddenOptions ();
61
66
final ServiceLoader <CodegenConfig > loader = ServiceLoader .load (CodegenConfig .class );
You can’t perform that action at this time.
0 commit comments