Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Fixed TypeScript generation error

Michael Rademaker231370ab8201
diff --git a/model/src/main/java/org/openremote/model/attribute/AttributeDescriptor.java b/model/src/main/java/org/openremote/model/attribute/AttributeDescriptor.java
index 74e4fa7f6..b2c8433bb 100644
--- a/model/src/main/java/org/openremote/model/attribute/AttributeDescriptor.java
+++ b/model/src/main/java/org/openremote/model/attribute/AttributeDescriptor.java
@@ -19,11 +19,13 @@
*/
package org.openremote.model.attribute;
+import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.openremote.model.value.Value;
@JsonDeserialize(as = AttributeDescriptorImpl.class)
+@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public interface AttributeDescriptor {
@JsonProperty
diff --git a/model/src/main/java/org/openremote/model/attribute/AttributeType.java b/model/src/main/java/org/openremote/model/attribute/AttributeType.java
index 5f27b1c38..6689568a8 100644
--- a/model/src/main/java/org/openremote/model/attribute/AttributeType.java
+++ b/model/src/main/java/org/openremote/model/attribute/AttributeType.java
@@ -19,13 +19,11 @@
*/
package org.openremote.model.attribute;
-import com.fasterxml.jackson.annotation.JsonFormat;
import org.openremote.model.value.Value;
import org.openremote.model.value.Values;
import static org.openremote.model.attribute.MetaItemType.*;
-@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum AttributeType implements AttributeDescriptor {
CONSOLE_NAME("consoleName", AttributeValueType.STRING),
diff --git a/model/src/main/java/org/openremote/model/attribute/AttributeValueDescriptor.java b/model/src/main/java/org/openremote/model/attribute/AttributeValueDescriptor.java
index cb0079ec2..608f5802b 100644
--- a/model/src/main/java/org/openremote/model/attribute/AttributeValueDescriptor.java
+++ b/model/src/main/java/org/openremote/model/attribute/AttributeValueDescriptor.java
@@ -19,6 +19,7 @@
*/
package org.openremote.model.attribute;
+import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@@ -30,6 +31,7 @@ import java.util.Optional;
import java.util.function.Function;
@JsonDeserialize(as = AttributeValueDescriptorImpl.class)
+@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public interface AttributeValueDescriptor {
@JsonProperty
diff --git a/model/src/main/java/org/openremote/model/attribute/AttributeValueType.java b/model/src/main/java/org/openremote/model/attribute/AttributeValueType.java
index 8adfcc072..04e820019 100644
--- a/model/src/main/java/org/openremote/model/attribute/AttributeValueType.java
+++ b/model/src/main/java/org/openremote/model/attribute/AttributeValueType.java
@@ -19,7 +19,6 @@
*/
package org.openremote.model.attribute;
-import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.openremote.model.ValidationFailure;
import org.openremote.model.ValueHolder;
@@ -30,8 +29,8 @@ import org.openremote.model.value.Values;
import java.util.Optional;
import java.util.function.Function;
-import static org.openremote.model.attribute.MetaItemType.*;
import static org.openremote.model.attribute.AttributeValueType.AttributeValueTypeFailureReason.ATTRIBUTE_TYPE_VALUE_DOES_NOT_MATCH;
+import static org.openremote.model.attribute.MetaItemType.*;
/**
* The type of an {@link Attribute}, how its {@link Value} should be
@@ -41,7 +40,6 @@ import static org.openremote.model.attribute.AttributeValueType.AttributeValueTy
* Additional constraints and integrity rules upon attribute values can be declared by
* adding arbitrary {@link Meta} to an {@link Attribute}.
*/
-@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum AttributeValueType implements AttributeValueDescriptor {
STRING("edit", ValueType.STRING),
diff --git a/ui/component/core/src/event.ts b/ui/component/core/src/event.ts
index 32d6aae49..535ca5b3f 100644
--- a/ui/component/core/src/event.ts
+++ b/ui/component/core/src/event.ts
@@ -502,7 +502,7 @@ export class WebSocketEventProvider extends EventProviderImpl {
}
} else if (msg.startsWith(EVENT_MESSAGE_PREFIX)) {
let str = msg.substring(EVENT_MESSAGE_PREFIX.length);
- let triggered = JSON.parse(str) as TriggeredEventSubscription<SharedEvent>;
+ let triggered = JSON.parse(str) as TriggeredEventSubscription;
if (triggered.events) {
triggered.events.forEach(event => {
this._onMessageReceived(triggered.subscriptionId!, event);