From 4ccaa8b38ef75a0e3acf8dffb4d4610e9d655d49 Mon Sep 17 00:00:00 2001 From: Christoph Weitkamp Date: Mon, 2 Sep 2019 16:55:43 +0200 Subject: [PATCH] [rest] Changed property type to Boolean to allow null values (#1010) Signed-off-by: Christoph Weitkamp --- .../eclipse/smarthome/io/rest/core/item/EnrichedItemDTO.java | 2 +- .../io/rest/core/internal/item/ItemResourceOSGiTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.core.io.rest.core/src/main/java/org/eclipse/smarthome/io/rest/core/item/EnrichedItemDTO.java b/bundles/org.openhab.core.io.rest.core/src/main/java/org/eclipse/smarthome/io/rest/core/item/EnrichedItemDTO.java index 5d4ed6abff..3ded7d8f55 100644 --- a/bundles/org.openhab.core.io.rest.core/src/main/java/org/eclipse/smarthome/io/rest/core/item/EnrichedItemDTO.java +++ b/bundles/org.openhab.core.io.rest.core/src/main/java/org/eclipse/smarthome/io/rest/core/item/EnrichedItemDTO.java @@ -34,7 +34,7 @@ public class EnrichedItemDTO extends ItemDTO { public StateDescription stateDescription; public CommandDescription commandDescription; public Map metadata; - public boolean editable; + public Boolean editable; public EnrichedItemDTO(ItemDTO itemDTO, String link, String state, String transformedState, StateDescription stateDescription, CommandDescription commandDescription) { diff --git a/itests/org.openhab.core.io.rest.core.tests/src/main/java/org/eclipse/smarthome/io/rest/core/internal/item/ItemResourceOSGiTest.java b/itests/org.openhab.core.io.rest.core.tests/src/main/java/org/eclipse/smarthome/io/rest/core/internal/item/ItemResourceOSGiTest.java index 12fa396a89..ff0f67f979 100644 --- a/itests/org.openhab.core.io.rest.core.tests/src/main/java/org/eclipse/smarthome/io/rest/core/internal/item/ItemResourceOSGiTest.java +++ b/itests/org.openhab.core.io.rest.core.tests/src/main/java/org/eclipse/smarthome/io/rest/core/internal/item/ItemResourceOSGiTest.java @@ -165,7 +165,7 @@ public class ItemResourceOSGiTest extends JavaOSGiTest { Response response = itemResource.getItems(null, null, "MyTag", null, false, "type,name"); JsonElement result = parser.parse(IOUtils.toString((InputStream) response.getEntity())); - JsonElement expected = parser.parse("[{editable: true, type: \"Switch\", name: \"Switch\"}]"); + JsonElement expected = parser.parse("[{type: \"Switch\", name: \"Switch\"}]"); assertEquals(expected, result); }