Open patvong opened 7 years ago
The problem is that the scanning is also configured via enunciate.xml
, so there's currently no way to do this.
Sorry!
Actually, instead of closing this, I'll turn this into an enhancement request seeking a sponsor.
What would be the best way to approach this in order to make Enunciate support this use case?
It would be a pretty significant shift in the architecture. We'd have to split the scanning and compilation away from the generating engine. We'd probably need two separate configuration files, one for the scanning/compilation and another for the generating engine. We'd have to figure out how to iterate over multiple generation steps.
The work would mostly be done in Enunciate.java
.
Instead this kind of process:
Enunciate enunciate = new Enunciate();
enunciate.setModules(modules);
enunciate.setBuildDir(buildDir);
enunciate.setConfig(config);
enunciate.setSourceFiles(sourceFiles);
enunciate.setClasspath(classpath);
enunciate.run();
It would need to look like this kind of process:
Enunciate enunciate = new Enunciate();
enunciate.setCompileConfig(compileConfig);
enunciate.setSourceFiles(sourceFiles);
enunciate.setClasspath(classpath);
enunciate.run(() -> {
EnunciateRun[] runs = ...;
for (EnunciateRun run : runs) {
run.setModules(modules);
run.setBuildDir(buildDir);
run.setConfig(config);
run.execute();
}
})
I'm currently using enunciate mainly to be able to use the generated
swagger.json
file that I process myself to create the HTML document for my APIs. Using the maven plugin, I have multiple executions:I was wondering if it would be feasible to scan the code only once in order to produce different
swagger.json
file? Currently it can take 10s to scan the code and I have more than 30 different enunciate configurations on the same code.