diff --git a/README.md b/README.md index 0c6942c5f..492ba37cd 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,10 @@ The project is very much Work In Progress and will be published on maven central # Release Notes BOAT is still under development and subject to change. +## 0.15.2 +* *Maven Plugin* + * Fixed handling of absolute file paths for linting OpenAPI specs + * Changed boat-bay dateLibrary for upload spec . ## 0.15.1 * *Maven Plugin* * Made `boat:radio` goal properties w.r.t boat-bay server unique. diff --git a/boat-engine/pom.xml b/boat-engine/pom.xml index a07222c14..d34ad2bb7 100644 --- a/boat-engine/pom.xml +++ b/boat-engine/pom.xml @@ -5,7 +5,7 @@ com.backbase.oss backbase-openapi-tools - 0.15.1 + 0.15.2 boat-engine jar diff --git a/boat-maven-plugin/pom.xml b/boat-maven-plugin/pom.xml index 5c9a773cc..07bd939d8 100644 --- a/boat-maven-plugin/pom.xml +++ b/boat-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.backbase.oss backbase-openapi-tools - 0.15.1 + 0.15.2 boat-maven-plugin @@ -357,7 +357,7 @@ com.backbase.oss.boat.bay.client.model com.backbase.oss.boat.bay.client.api feign - java8-localdatetime + java8 @lombok.AllArgsConstructor @lombok.Builder @lombok.NoArgsConstructor diff --git a/boat-quay/boat-quay-lint/pom.xml b/boat-quay/boat-quay-lint/pom.xml index 9d69b3d15..55837e372 100644 --- a/boat-quay/boat-quay-lint/pom.xml +++ b/boat-quay/boat-quay-lint/pom.xml @@ -5,7 +5,7 @@ com.backbase.oss boat-quay - 0.15.1 + 0.15.2 boat-quay-lint jar diff --git a/boat-quay/boat-quay-lint/src/main/java/com/backbase/oss/boat/quay/BoatLinter.java b/boat-quay/boat-quay-lint/src/main/java/com/backbase/oss/boat/quay/BoatLinter.java index b11c42f16..757b245a3 100644 --- a/boat-quay/boat-quay-lint/src/main/java/com/backbase/oss/boat/quay/BoatLinter.java +++ b/boat-quay/boat-quay-lint/src/main/java/com/backbase/oss/boat/quay/BoatLinter.java @@ -62,6 +62,11 @@ public BoatLintReport lint(File inputFile) throws IOException, OpenAPILoaderExce @NotNull private Path getFilePath(File inputFile) { File workingDirectory = new File("."); + + if (inputFile.isAbsolute()) { + workingDirectory = workingDirectory.getAbsoluteFile(); + } + Path relativize; try { relativize = workingDirectory.toPath().relativize(inputFile.toPath()); diff --git a/boat-quay/boat-quay-lint/src/test/java/com/backbase/oss/boat/quay/BoatLinterTests.java b/boat-quay/boat-quay-lint/src/test/java/com/backbase/oss/boat/quay/BoatLinterTests.java index e27b1fdbf..9639fefa2 100644 --- a/boat-quay/boat-quay-lint/src/test/java/com/backbase/oss/boat/quay/BoatLinterTests.java +++ b/boat-quay/boat-quay-lint/src/test/java/com/backbase/oss/boat/quay/BoatLinterTests.java @@ -1,5 +1,9 @@ package com.backbase.oss.boat.quay; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.backbase.oss.boat.loader.OpenAPILoaderException; import com.backbase.oss.boat.quay.model.BoatLintReport; import com.backbase.oss.boat.quay.model.BoatLintRule; @@ -11,7 +15,6 @@ import java.util.List; import java.util.Optional; import org.apache.commons.io.IOUtils; -import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -55,6 +58,19 @@ void testRulesWithFile() throws IOException, OpenAPILoaderException { assertTrue(boatLintReport.hasViolations()); } + @Test + void testRulesWithFile_absolutePath() throws IOException, OpenAPILoaderException { + // Can't ret relative file from class path resources. Copy into new file + String openApiContents = IOUtils.resourceToString("/openapi/presentation-client-api/openapi.yaml", Charset.defaultCharset()); + + File inputFile = new File("target/openapi.yaml").getAbsoluteFile(); + Files.write(inputFile.toPath(), openApiContents.getBytes()); + + BoatLintReport boatLintReport = boatLinter.lint(inputFile); + + assertTrue(boatLintReport.hasViolations()); + } + @Test void ruleManager() { List availableRules = boatLinter.getAvailableRules(); diff --git a/boat-quay/boat-quay-rules/pom.xml b/boat-quay/boat-quay-rules/pom.xml index d03930153..8bde40106 100644 --- a/boat-quay/boat-quay-rules/pom.xml +++ b/boat-quay/boat-quay-rules/pom.xml @@ -5,7 +5,7 @@ com.backbase.oss boat-quay - 0.15.1 + 0.15.2 boat-quay-rules jar diff --git a/boat-quay/pom.xml b/boat-quay/pom.xml index c766ab0ff..770e9946a 100644 --- a/boat-quay/pom.xml +++ b/boat-quay/pom.xml @@ -5,7 +5,7 @@ com.backbase.oss backbase-openapi-tools - 0.15.1 + 0.15.2 diff --git a/boat-scaffold/pom.xml b/boat-scaffold/pom.xml index ba4cd29d6..207e63b4f 100644 --- a/boat-scaffold/pom.xml +++ b/boat-scaffold/pom.xml @@ -5,7 +5,7 @@ com.backbase.oss backbase-openapi-tools - 0.15.1 + 0.15.2 boat-scaffold @@ -86,7 +86,7 @@ com.backbase.oss boat-trail-resources - 0.15.1 + 0.15.2 test diff --git a/boat-terminal/pom.xml b/boat-terminal/pom.xml index 9bc31c667..5a23b9ee5 100644 --- a/boat-terminal/pom.xml +++ b/boat-terminal/pom.xml @@ -5,7 +5,7 @@ com.backbase.oss backbase-openapi-tools - 0.15.1 + 0.15.2 boat-terminal diff --git a/boat-trail-resources/pom.xml b/boat-trail-resources/pom.xml index ac859c0e9..f159e4981 100644 --- a/boat-trail-resources/pom.xml +++ b/boat-trail-resources/pom.xml @@ -5,7 +5,7 @@ com.backbase.oss backbase-openapi-tools - 0.15.1 + 0.15.2 boat-trail-resources diff --git a/pom.xml b/pom.xml index df5594695..881f7a334 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.backbase.oss backbase-openapi-tools - 0.15.1 + 0.15.2 pom Backbase Open Api Tools will help you converting RAML to OpenAPI plus many more diff --git a/tests/pom.xml b/tests/pom.xml index 0fcfa648f..d78a480a8 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -5,7 +5,7 @@ com.backbase.oss backbase-openapi-tools - 0.15.1 + 0.15.2 tests