inline documentation fixed
This commit is contained in:
parent
66b46259b2
commit
a118cf6c0b
@ -58,7 +58,7 @@ public class ExportApisToWso2FromV32 extends AbstractProcess {
|
||||
|
||||
ArtifactSearchResults apis = client.searchArtifacts(config.getApicurio().getDefaultApiGroup(), null, null,
|
||||
null, null, SortBy.name, SortOrder.asc, null, 9999);
|
||||
|
||||
|
||||
List<SearchedArtifact> sortedArtifacts = apis.getArtifacts().stream()
|
||||
.sorted(Comparator.comparing(SearchedArtifact::getId))
|
||||
.collect(Collectors.toList());
|
||||
@ -66,24 +66,25 @@ public class ExportApisToWso2FromV32 extends AbstractProcess {
|
||||
log.info("Found {} APIs", sortedArtifacts.size());
|
||||
|
||||
int maxThreads = config.getMaxThreads();
|
||||
//ExecutorService executor = Executors.newFixedThreadPool(maxThreads);
|
||||
|
||||
int skipCount = 9;
|
||||
// ExecutorService executor = Executors.newFixedThreadPool(maxThreads);
|
||||
|
||||
// AutosweepIntegrationPPE/AutosweepIntegrationPPE/v1
|
||||
int skipCount = 23;
|
||||
|
||||
for (SearchedArtifact api : sortedArtifacts) {
|
||||
final int index = apiCounter.getAndIncrement();
|
||||
if (index <= skipCount) {
|
||||
log.info("Skipping API {} of {}: {}", index, apis.getCount(), api.getName());
|
||||
continue;
|
||||
if (index <= skipCount) {
|
||||
log.info("Skipping API {} of {}: {}", index, apis.getCount(), api.getName());
|
||||
continue;
|
||||
}
|
||||
//executor.submit(() -> processApi(api, token, index, apis.getCount()));
|
||||
// executor.submit(() -> processApi(api, token, index, apis.getCount()));
|
||||
processApi(api, token, index, apis.getCount());
|
||||
}
|
||||
|
||||
// executor.shutdown();
|
||||
// if (!executor.awaitTermination(10, TimeUnit.MINUTES)) {
|
||||
// log.warn("Timeout waiting for API import tasks to finish");
|
||||
// }
|
||||
// executor.shutdown();
|
||||
// if (!executor.awaitTermination(10, TimeUnit.MINUTES)) {
|
||||
// log.warn("Timeout waiting for API import tasks to finish");
|
||||
// }
|
||||
log.info("Finished processing APIs.");
|
||||
} catch (Exception e) {
|
||||
log.error("Error while exporting APIs.", e);
|
||||
@ -186,10 +187,18 @@ public class ExportApisToWso2FromV32 extends AbstractProcess {
|
||||
} else if (FileType.DOCUMENTATION.toString().equals(amd.getGroupId())) {
|
||||
subDir = "Docs/";
|
||||
if (content != null && content.length > 0) {
|
||||
List<Documents32> docs = mapperYaml.readValue(content, new TypeReference<List<Documents32>>() {
|
||||
});
|
||||
for (Documents32 doc : docs) {
|
||||
convertAndAddDocument(zos, baseDir + subDir, doc, ref);
|
||||
if (r.getName().endsWith(".yaml") || r.getName().endsWith(".yml")) {
|
||||
List<Documents32> docs = mapperYaml.readValue(content,
|
||||
new TypeReference<List<Documents32>>() {
|
||||
});
|
||||
for (Documents32 doc : docs) {
|
||||
convertAndAddDocument(zos, baseDir + subDir, doc, ref);
|
||||
}
|
||||
} else {
|
||||
String fileName = baseDir + subDir + r.getName() + "/" + r.getName();
|
||||
zos.putNextEntry(new ZipEntry(fileName));
|
||||
zos.write(content);
|
||||
zos.closeEntry();
|
||||
}
|
||||
}
|
||||
appendFile = false;
|
||||
@ -221,7 +230,8 @@ public class ExportApisToWso2FromV32 extends AbstractProcess {
|
||||
}
|
||||
}
|
||||
|
||||
private void convertAndAddDocument(ZipOutputStream zos, String subDir, Documents32 doc, List<ArtifactReference> ref) throws Exception {
|
||||
private void convertAndAddDocument(ZipOutputStream zos, String subDir, Documents32 doc, List<ArtifactReference> ref)
|
||||
throws Exception {
|
||||
Documents45 doc45 = new Documents45();
|
||||
|
||||
Documents45.Data doc45Data = new Documents45.Data();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user