Fixing bug 24240

This commit is contained in:
Luca Frosini 2022-12-05 15:10:20 +01:00
parent cab37c6fc2
commit 13c25410fa
2 changed files with 6 additions and 0 deletions

View File

@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [v4.1.1-SNAPSHOT] ## [v4.1.1-SNAPSHOT]
- Fixed bug on JSONQuery for Facets which does not have any properties to match [#24237] - 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] ## [v4.1.0]

View File

@ -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.JsonNode;
import org.gcube.com.fasterxml.jackson.databind.ObjectMapper; 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.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.JsonNodeType;
import org.gcube.com.fasterxml.jackson.databind.node.ObjectNode; import org.gcube.com.fasterxml.jackson.databind.node.ObjectNode;
import org.gcube.com.fasterxml.jackson.databind.node.TextNode; import org.gcube.com.fasterxml.jackson.databind.node.TextNode;
@ -1194,6 +1195,10 @@ public abstract class ElementManagement<El extends OElement, T extends Type> {
return objectNode; return objectNode;
} }
if(object instanceof Boolean) {
return BooleanNode.valueOf((Boolean) object);
}
return new TextNode(object.toString()); return new TextNode(object.toString());
} catch(Exception e) { } catch(Exception e) {