mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-05 15:10:49 +00:00
[MAVEN PLUGIN] fix javadoc + sonarlint (#2399)
This commit is contained in:
parent
b67318ef21
commit
218c2e75ab
@ -37,7 +37,6 @@ public class OpenAPIGenerator {
|
|||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
String version = Version.readVersionFromResources();
|
String version = Version.readVersionFromResources();
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
Cli.CliBuilder<Runnable> builder =
|
Cli.CliBuilder<Runnable> builder =
|
||||||
Cli.<Runnable>builder("openapi-generator-cli")
|
Cli.<Runnable>builder("openapi-generator-cli")
|
||||||
.withDescription(
|
.withDescription(
|
||||||
|
@ -49,7 +49,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
@Command(name = "generate", description = "Generate code with the specified generator.")
|
@Command(name = "generate", description = "Generate code with the specified generator.")
|
||||||
public class Generate implements Runnable {
|
public class Generate implements Runnable {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(Generate.class);
|
// private static final Logger LOGGER = LoggerFactory.getLogger(Generate.class);
|
||||||
|
|
||||||
@Option(name = {"-v", "--verbose"}, description = "verbose mode")
|
@Option(name = {"-v", "--verbose"}, description = "verbose mode")
|
||||||
private Boolean verbose;
|
private Boolean verbose;
|
||||||
|
@ -9,7 +9,6 @@ import org.openapitools.codegen.CodegenConfig;
|
|||||||
import org.openapitools.codegen.CodegenConfigLoader;
|
import org.openapitools.codegen.CodegenConfigLoader;
|
||||||
import org.openapitools.codegen.CodegenType;
|
import org.openapitools.codegen.CodegenType;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
@ -62,7 +61,7 @@ public class ListGenerators implements Runnable {
|
|||||||
.sorted(Comparator.comparing(CodegenConfig::getName))
|
.sorted(Comparator.comparing(CodegenConfig::getName))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
if(list.size() > 0) {
|
if(!list.isEmpty()) {
|
||||||
if (docusaurus) {
|
if (docusaurus) {
|
||||||
sb.append("## ").append(typeName).append(" generators");
|
sb.append("## ").append(typeName).append(" generators");
|
||||||
} else {
|
} else {
|
||||||
|
@ -45,8 +45,8 @@ public class Validate implements Runnable {
|
|||||||
|
|
||||||
SwaggerParseResult result = new OpenAPIParser().readLocation(spec, null, null);
|
SwaggerParseResult result = new OpenAPIParser().readLocation(spec, null, null);
|
||||||
List<String> messageList = result.getMessages();
|
List<String> messageList = result.getMessages();
|
||||||
Set<String> errors = new HashSet<String>(messageList);
|
Set<String> errors = new HashSet<>(messageList);
|
||||||
Set<String> warnings = new HashSet<String>();
|
Set<String> warnings = new HashSet<>();
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
OpenAPI specification = result.getOpenAPI();
|
OpenAPI specification = result.getOpenAPI();
|
||||||
@ -61,7 +61,7 @@ public class Validate implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errors.size() > 0) {
|
if (!errors.isEmpty()) {
|
||||||
sb.append("Errors:").append(System.lineSeparator());
|
sb.append("Errors:").append(System.lineSeparator());
|
||||||
errors.forEach(msg ->
|
errors.forEach(msg ->
|
||||||
sb.append("\t-").append(msg).append(System.lineSeparator())
|
sb.append("\t-").append(msg).append(System.lineSeparator())
|
||||||
|
@ -267,9 +267,6 @@ public class CodeGenMojo extends AbstractMojo {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A map of additional properties that can be referenced by the mustache templates
|
* A map of additional properties that can be referenced by the mustache templates
|
||||||
* <additionalProperties>
|
|
||||||
* <additionalProperty>key=value</additionalProperty>
|
|
||||||
* </additionalProperties>
|
|
||||||
*/
|
*/
|
||||||
@Parameter(name = "additionalProperties")
|
@Parameter(name = "additionalProperties")
|
||||||
private List<String> additionalProperties;
|
private List<String> additionalProperties;
|
||||||
|
3
pom.xml
3
pom.xml
@ -226,13 +226,12 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
<version>3.0.1</version>
|
<version>3.1.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.8</source>
|
<source>1.8</source>
|
||||||
<encoding>UTF-8</encoding>
|
<encoding>UTF-8</encoding>
|
||||||
<maxmemory>1g</maxmemory>
|
<maxmemory>1g</maxmemory>
|
||||||
<failOnWarnings>true</failOnWarnings>
|
<failOnWarnings>true</failOnWarnings>
|
||||||
<excludePackageNames></excludePackageNames>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user