diff --git a/CHANGELOG.md b/CHANGELOG.md index 09423886..7b59cdd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,21 @@ --- +## [0.15.5] - 2024-11-20 + +### Added + +- + +### Changed + +- + +### Fixed + +- Command `mvn clean compile polyapi:deploy-functions` failed issue resolved +--- + ## [0.15.4] - 2024-11-15 ### Added diff --git a/README.md b/README.md index ee9a7089..2b931986 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Java Client Library -* Latest released version 0.15.4 -* Latest snapshot version 0.15.4-SNAPSHOT +* Latest released version 0.15.5 +* Latest snapshot version 0.15.5-SNAPSHOT ## Introduction Welcome my friends! This is the PolyAPI Java client GitHub page. If you are here, then it means you're familiar with what we do at Poly. If you aren't, you can always check [here](https://github.com/polyapi/poly-alpha). @@ -55,7 +55,7 @@ Nice to have some customers looking around here! So, you'll need to run the foll 2. **Update the project.** Add the following to your project's `pom.xml`: ```xml - 0.15.4 + 0.15.5 @@ -75,6 +75,11 @@ Nice to have some customers looking around here! So, you'll need to run the foll io.polyapi polyapi-maven-plugin ${poly.version} + + https://na1.polyapi.io + 443 + {API_KEY} + generate-sources @@ -82,7 +87,7 @@ Nice to have some customers looking around here! So, you'll need to run the foll generate-sources - https://develop-k8s.polyapi.io + https://na1.polyapi.io 443 {API_KEY} @@ -92,7 +97,7 @@ Nice to have some customers looking around here! So, you'll need to run the foll org.apache.maven.plugins maven-compiler-plugin - 3.12.1 + 3.13.0 true diff --git a/commons/pom.xml b/commons/pom.xml index 50f775e1..a769195b 100644 --- a/commons/pom.xml +++ b/commons/pom.xml @@ -4,7 +4,7 @@ io.polyapi parent-pom - 0.15.4-SNAPSHOT + 0.15.5-SNAPSHOT ../parent-pom diff --git a/library/pom.xml b/library/pom.xml index 2700a956..983cbb06 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -4,7 +4,7 @@ io.polyapi parent-pom - 0.15.4-SNAPSHOT + 0.15.5-SNAPSHOT ../parent-pom library diff --git a/parent-pom/pom.xml b/parent-pom/pom.xml index de00371e..2de2484b 100644 --- a/parent-pom/pom.xml +++ b/parent-pom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.polyapi parent-pom - 0.15.4-SNAPSHOT + 0.15.5-SNAPSHOT pom PolyAPI Java parent POM https://polyapi.io diff --git a/polyapi-maven-plugin/pom.xml b/polyapi-maven-plugin/pom.xml index 1b4b0d90..6f35072a 100644 --- a/polyapi-maven-plugin/pom.xml +++ b/polyapi-maven-plugin/pom.xml @@ -4,7 +4,7 @@ io.polyapi parent-pom - 0.15.4-SNAPSHOT + 0.15.5-SNAPSHOT ../parent-pom polyapi-maven-plugin diff --git a/polyapi-maven-plugin/src/main/java/io/polyapi/plugin/model/function/PolyFunction.java b/polyapi-maven-plugin/src/main/java/io/polyapi/plugin/model/function/PolyFunction.java index 47a5b05f..95950b07 100644 --- a/polyapi-maven-plugin/src/main/java/io/polyapi/plugin/model/function/PolyFunction.java +++ b/polyapi-maven-plugin/src/main/java/io/polyapi/plugin/model/function/PolyFunction.java @@ -1,6 +1,7 @@ package io.polyapi.plugin.model.function; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.polyapi.commons.api.model.Visibility; import lombok.Getter; import lombok.Setter; @@ -28,6 +29,7 @@ public class PolyFunction { private String returnType; private Visibility visibility; private Boolean logsEnabled; + @JsonDeserialize(using = RequirementsDeserializer.class) private List requirements; private Map returnTypeSchema; diff --git a/polyapi-maven-plugin/src/main/java/io/polyapi/plugin/model/function/RequirementsDeserializer.java b/polyapi-maven-plugin/src/main/java/io/polyapi/plugin/model/function/RequirementsDeserializer.java new file mode 100644 index 00000000..0a2ca47e --- /dev/null +++ b/polyapi-maven-plugin/src/main/java/io/polyapi/plugin/model/function/RequirementsDeserializer.java @@ -0,0 +1,39 @@ +package io.polyapi.plugin.model.function; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class RequirementsDeserializer extends JsonDeserializer> { + + @Override + public List deserialize(JsonParser jsonParser, DeserializationContext context) throws IOException { + JsonNode node = jsonParser.getCodec().readTree(jsonParser); + + if (node.isArray() && node.isEmpty()) { + return Collections.emptyList(); + } + + if (node.isArray()) { + List requirements = new ArrayList<>(); + for (JsonNode item : node) { + if (item.isTextual()) { + requirements.add(item.asText()); + } + } + return requirements; + } + + if (node.isTextual() && "[]".equals(node.asText())) { + return Collections.emptyList(); + } + + return Collections.emptyList(); + } +} diff --git a/pom.xml b/pom.xml index 430978c2..1611ed06 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.polyapi polyapi-java - 0.15.4-SNAPSHOT + 0.15.5-SNAPSHOT pom parent-pom