diff --git a/README.md b/README.md index e00cc483..42f5d89f 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ As commented above, they both could be used at the same time, setting a double com.sngular scs-multiapi-maven-plugin - 5.3.4 + 5.3.5 asyncapi @@ -114,7 +114,7 @@ Apply the plugin in the `build.gradle` file and invoke the task. ```groovy plugins { id "java" - id "com.sngular.scs-multiapi-gradle-plugin' version '5.3.4" + id "com.sngular.scs-multiapi-gradle-plugin' version '5.3.5" openapimodel { @@ -153,7 +153,7 @@ which the plugin is designed. com.sngular scs-multiapi-maven-plugin - 5.3.4 + 5.3.5 generate-sources @@ -584,7 +584,7 @@ file. Here is an example of a basic configuration: com.sngular scs-multiapi-maven-plugin - 5.3.4 + 5.3.5 diff --git a/multiapi-engine/pom.xml b/multiapi-engine/pom.xml index 2ec7ae92..e2345f0a 100644 --- a/multiapi-engine/pom.xml +++ b/multiapi-engine/pom.xml @@ -4,7 +4,7 @@ com.sngular multiapi-engine - 5.3.4 + 5.3.5 jar diff --git a/multiapi-engine/src/main/java/com/sngular/api/generator/plugin/asyncapi/util/MapperUtil.java b/multiapi-engine/src/main/java/com/sngular/api/generator/plugin/asyncapi/util/MapperUtil.java index ce68ef48..cf536e62 100644 --- a/multiapi-engine/src/main/java/com/sngular/api/generator/plugin/asyncapi/util/MapperUtil.java +++ b/multiapi-engine/src/main/java/com/sngular/api/generator/plugin/asyncapi/util/MapperUtil.java @@ -64,17 +64,17 @@ public static String getSimpleType(final JsonNode schema, final String prefix, f type = formatTypeOfString(format, useTimeType); } else if (NUMBER.equalsIgnoreCase(type)) { if (FLOAT.equalsIgnoreCase(format)) { - type = FLOAT; + type = StringUtils.capitalize(FLOAT); } else if (DOUBLE.equalsIgnoreCase(format)) { - type = DOUBLE; + type = StringUtils.capitalize(DOUBLE); } else { - type = BIG_DECIMAL; + type = StringUtils.capitalize(BIG_DECIMAL); } } else if (INTEGER.equalsIgnoreCase(type)) { if (INT_64.equalsIgnoreCase(format)) { - type = LONG; + type = StringUtils.capitalize(LONG); } else { - type = INTEGER; + type = StringUtils.capitalize(INTEGER); } } } else if (schema.has(REF)) { diff --git a/multiapi-engine/src/main/java/com/sngular/api/generator/plugin/asyncapi/util/ReferenceProcessor.java b/multiapi-engine/src/main/java/com/sngular/api/generator/plugin/asyncapi/util/ReferenceProcessor.java index 07c902c7..29d831f0 100644 --- a/multiapi-engine/src/main/java/com/sngular/api/generator/plugin/asyncapi/util/ReferenceProcessor.java +++ b/multiapi-engine/src/main/java/com/sngular/api/generator/plugin/asyncapi/util/ReferenceProcessor.java @@ -19,6 +19,8 @@ public final class ReferenceProcessor { private static final String YML = "yml"; + private static final String YAML = "yaml"; + private static final String REF = "$ref"; private static final String AVSC = "avsc"; @@ -78,7 +80,7 @@ private JsonNode solveRef(final FileLocation ymlParent, final String[] path, fin final String filePath = pathToFile[0]; JsonNode returnNode = null; - if (filePath.endsWith(YML) || filePath.endsWith(JSON)) { + if (filePath.endsWith(YML) || filePath.endsWith(JSON) || filePath.endsWith(YAML)) { final JsonNode node = ApiTool.nodeFromFile(ymlParent, filePath, FactoryTypeEnum.YML); if (node.findValue(path[path.length - 2]).has(path[path.length - 1])) { returnNode = node.findValue(path[path.length - 2]).get(path[path.length - 1]); diff --git a/multiapi-engine/src/main/java/com/sngular/api/generator/plugin/openapi/utils/MapperPathUtil.java b/multiapi-engine/src/main/java/com/sngular/api/generator/plugin/openapi/utils/MapperPathUtil.java index 75298ca2..e8e87ed3 100644 --- a/multiapi-engine/src/main/java/com/sngular/api/generator/plugin/openapi/utils/MapperPathUtil.java +++ b/multiapi-engine/src/main/java/com/sngular/api/generator/plugin/openapi/utils/MapperPathUtil.java @@ -130,6 +130,7 @@ private static List mapOperationObject(final SpecFile specFile, private static OperationObject createOperation( final JsonNode operation, final String operationType, final SpecFile specFile, final GlobalObject globalObject, final List operationIdList, final Path baseDir) { + Objects.requireNonNull(operation.get("tags"), "Tags element is required"); return OperationObject.builder() .operationId(mapOperationId(getOperationId(operation), operationIdList)) .operationType(operationType) diff --git a/multiapi-engine/src/test/resources/asyncapigenerator/testCustomValidators/assets/DataDTO.java b/multiapi-engine/src/test/resources/asyncapigenerator/testCustomValidators/assets/DataDTO.java index 5f9d8059..11efb65f 100644 --- a/multiapi-engine/src/test/resources/asyncapigenerator/testCustomValidators/assets/DataDTO.java +++ b/multiapi-engine/src/test/resources/asyncapigenerator/testCustomValidators/assets/DataDTO.java @@ -41,7 +41,7 @@ public class DataDTO { @MinItems(minimum = 5) @UniqueItems @NotNull - private final List test = new ArrayList(); + private final List test = new ArrayList(); private DataDTO(DataDTOBuilder builder) { this.clientId = builder.clientId; @@ -65,7 +65,7 @@ public static class DataDTOBuilder { private String flightNumber; - private List test = new ArrayList(); + private List test = new ArrayList(); public DataDTO.DataDTOBuilder clientId(Integer clientId) { this.clientId = clientId; @@ -82,14 +82,14 @@ public DataDTO.DataDTOBuilder flightNumber(String flightNumber) { return this; } - public DataDTO.DataDTOBuilder test(List test) { + public DataDTO.DataDTOBuilder test(List test) { if (!test.isEmpty()) { this.test.addAll(test); } return this; } - public DataDTO.DataDTOBuilder test(integer test) { + public DataDTO.DataDTOBuilder test(Integer test) { if (test != null) { this.test.add(test); } @@ -134,7 +134,7 @@ public String getFlightNumber() { * @return test */ @Schema(name = "test", required = true) - public List getTest() { + public List getTest() { return test; } diff --git a/scs-multiapi-gradle-plugin/build.gradle b/scs-multiapi-gradle-plugin/build.gradle index f40b0096..38acf355 100644 --- a/scs-multiapi-gradle-plugin/build.gradle +++ b/scs-multiapi-gradle-plugin/build.gradle @@ -20,7 +20,7 @@ repositories { } group = 'com.sngular' -version = '5.3.4' +version = '5.3.5' def SCSMultiApiPluginGroupId = group def SCSMultiApiPluginVersion = version @@ -30,7 +30,7 @@ dependencies { shadow localGroovy() shadow gradleApi() - implementation 'com.sngular:multiapi-engine:5.3.4' + implementation 'com.sngular:multiapi-engine:5.3.5' testImplementation 'org.assertj:assertj-core:3.24.2' testImplementation 'com.puppycrawl.tools:checkstyle:10.12.3' } @@ -98,7 +98,7 @@ testing { integrationTest(JvmTestSuite) { dependencies { - implementation 'com.sngular:scs-multiapi-gradle-plugin:5.3.4' + implementation 'com.sngular:scs-multiapi-gradle-plugin:5.3.5' implementation 'org.assertj:assertj-core:3.24.2' } diff --git a/scs-multiapi-maven-plugin/pom.xml b/scs-multiapi-maven-plugin/pom.xml index a05568b8..e554ee14 100644 --- a/scs-multiapi-maven-plugin/pom.xml +++ b/scs-multiapi-maven-plugin/pom.xml @@ -4,7 +4,7 @@ com.sngular scs-multiapi-maven-plugin - 5.3.4 + 5.3.5 maven-plugin AsyncApi - OpenApi Code Generator Maven Plugin @@ -243,7 +243,7 @@ com.sngular multiapi-engine - 5.3.4 + 5.3.5 org.apache.maven