From 13c25410fa42958c4b2bb1742b88e075ca156981 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Mon, 5 Dec 2022 15:10:20 +0100 Subject: [PATCH] Fixing bug 24240 --- CHANGELOG.md | 1 + .../resourceregistry/instances/base/ElementManagement.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f1562a..4b72bbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [v4.1.1-SNAPSHOT] - Fixed bug on JSONQuery for Facets which does not have any properties to match [#24237] +- Fixed bug on returned boolean values as string [#24240] ## [v4.1.0] diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/instances/base/ElementManagement.java b/src/main/java/org/gcube/informationsystem/resourceregistry/instances/base/ElementManagement.java index dbf54b8..16c6c6f 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/instances/base/ElementManagement.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/instances/base/ElementManagement.java @@ -20,6 +20,7 @@ import org.gcube.com.fasterxml.jackson.core.JsonProcessingException; import org.gcube.com.fasterxml.jackson.databind.JsonNode; import org.gcube.com.fasterxml.jackson.databind.ObjectMapper; import org.gcube.com.fasterxml.jackson.databind.node.ArrayNode; +import org.gcube.com.fasterxml.jackson.databind.node.BooleanNode; import org.gcube.com.fasterxml.jackson.databind.node.JsonNodeType; import org.gcube.com.fasterxml.jackson.databind.node.ObjectNode; import org.gcube.com.fasterxml.jackson.databind.node.TextNode; @@ -1194,6 +1195,10 @@ public abstract class ElementManagement { return objectNode; } + if(object instanceof Boolean) { + return BooleanNode.valueOf((Boolean) object); + } + return new TextNode(object.toString()); } catch(Exception e) {