From e67cd676c5e86ae8fb9d0269d964811e29699cd6 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 21 Nov 2024 12:12:27 -0800 Subject: [PATCH 01/15] Adding discoverynode example --- bin/test_schema | 4 ++-- tests/schemas/events_discovery/discoverynode.json | 1 + tests/schemas/events_discovery/discoverynode.out | 0 .../main/java/com/google/daq/mqtt/validator/Validator.java | 1 - 4 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 tests/schemas/events_discovery/discoverynode.json create mode 100644 tests/schemas/events_discovery/discoverynode.out diff --git a/bin/test_schema b/bin/test_schema index 19f6c3a40f..8d733e8309 100755 --- a/bin/test_schema +++ b/bin/test_schema @@ -15,7 +15,7 @@ upgrade= schemadir=schema testdir=tests/schemas/ outroot=out -rm -rf outroot/tests +rm -rf $outroot/tests while getopts "d:s:fnu" opt; do case $opt in @@ -69,7 +69,7 @@ for subset in $subsets; do reldir=$(realpath --relative-to $schemadir $testdir) reltest=$reldir:$subset fi - cmd="$javarun -a $schemaname $upgrade -f $reltest" + cmd="$javarun -n -a $schemaname $upgrade -f $reltest" echo $cmd (cd $schemadir; $cmd) || true diff --git a/tests/schemas/events_discovery/discoverynode.json b/tests/schemas/events_discovery/discoverynode.json new file mode 100644 index 0000000000..c96ab7a58b --- /dev/null +++ b/tests/schemas/events_discovery/discoverynode.json @@ -0,0 +1 @@ +{"timestamp":"2024-11-21T12:10:46Z","version":"1.5.1","generation":"2024-11-21T12:09:30Z","scan_family":"bacnet","scan_addr":"10117","event_no":9,"families":{"ipv4":{"addr":"192.168.1.131"}},"refs":{"AI:1":{"name":"FCU_1180 Room Temp","possible_values":[],"units":"degreesCelsius","description":"","ancillary":{"present_value":20.488115310668945}},"AI:2":{"name":"FCU_1180 Supply Air Temp","possible_values":[],"units":"degreesCelsius","description":"","ancillary":{"present_value":20.14183235168457}},"AO:1":{"name":"FCU_1180 Heating Valve","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":0.0}},"AO:2":{"name":"FCU_1180 Cooling Valve","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":0.0}},"AO:3":{"name":"FCU_1180 Fan Speed","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":70.0}},"AV:1":{"name":"FCU_1180 Setpoint","possible_values":[],"units":"degreesCelsius","description":"","ancillary":{"present_value":20.0}},"AV:2":{"name":"FCU_1180 Min Fan Speed","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":20.0}},"AV:3":{"name":"FCU_1180 Max Fan Speed","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":100.0}},"AV:4":{"name":"FCU_1180 Design Fan Speed","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":70.0}},"AV:5":{"name":"FCU_1180 Design Heating Valve Position","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":75.0}},"AV:6":{"name":"FCU_1180 Design Cooling Valve Position","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":67.0}},"AV:7":{"name":"FCU_1180 Mode_Mimic","possible_values":[],"units":"noUnits","description":"","ancillary":{"present_value":1.0}},"AV:9991":{"name":"FCU_1180 Comfort KPI Score (Live)","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":69.89265441894531}},"AV:9992":{"name":"FCU_1180 Comfort KPI Score (Yesterday)","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":69.99639129638672}},"BI:3":{"name":"FCU_1180 Fan Status","possible_values":[],"description":"","ancillary":{"present_value":"active"}},"BI:4":{"name":"FCU_1180 Occupancy","possible_values":[],"description":"","ancillary":{"present_value":"active"}},"BO:4":{"name":"FCU_1180 Enable","possible_values":[],"description":"","ancillary":{"present_value":"active"}},"BV:1":{"name":"FCU_1180 BMS Remote","possible_values":[],"description":"","ancillary":{"present_value":"active"}},"BV:2":{"name":"FCU_1180 FCU Run Status","possible_values":[],"description":"","ancillary":{"present_value":"active"}},"BV:9991":{"name":"FCU_1180 Within Bounds","possible_values":[],"description":"","ancillary":{"present_value":"active"}},"MSV:1":{"name":"FCU_1180 Mode","possible_values":["Auto_","On_","Off_","Flushing_","Commissioning_"],"description":"","ancillary":{"present_value":1}},"LP:1":{"name":"FCU_101 Valve Control Loop","possible_values":[],"description":"","ancillary":{"present_value":50.0}},"LP:2":{"name":"FCU_101 Fan Control Loop","possible_values":[],"description":"","ancillary":{"present_value":50.0}},"CSV:1":{"name":"Google Cloud IoT Gateway Configuration","possible_values":[],"description":"","ancillary":{"present_value":"{\n \"hostName\": \"mqtt.bos.goog\",\n \"tcpPort\": 8883,\n \"location\": \"us-central1\",\n \"project\": \"bos-platform-testing\",\n \"registry\": \"UK-LON-GLAB\",\n \"device\": \"DDC-17\"\n}"}},"CSV:1000001":{"name":"BLE PIN","possible_values":[],"description":"","ancillary":{"present_value":"800700"}}},"system":{"serial_no":"141557/0009","ancillary":{"name":"DDC-17"},"hardware":{"make":"Delta Controls Inc.","model":"Red5-PLUS-1180"}}} \ No newline at end of file diff --git a/tests/schemas/events_discovery/discoverynode.out b/tests/schemas/events_discovery/discoverynode.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java b/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java index 69edeff7c8..817c4c6470 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java @@ -1190,7 +1190,6 @@ private void validateFilesOutput(String targetSpec) { } catch (ExceptionMap processingException) { ErrorTree errorTree = ExceptionMap.format(processingException); errorTree.write(System.err); - throw processingException; } } From 86f619c21d2276b71a49866405d19dae4a42c63c Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 21 Nov 2024 19:51:09 -0800 Subject: [PATCH 02/15] Example cleanup --- .../events_discovery/discovery_node.json | 245 ++++++++++++++++++ .../{discoverynode.out => discovery_node.out} | 0 .../events_discovery/discoverynode.json | 1 - 3 files changed, 245 insertions(+), 1 deletion(-) create mode 100644 tests/schemas/events_discovery/discovery_node.json rename tests/schemas/events_discovery/{discoverynode.out => discovery_node.out} (100%) delete mode 100644 tests/schemas/events_discovery/discoverynode.json diff --git a/tests/schemas/events_discovery/discovery_node.json b/tests/schemas/events_discovery/discovery_node.json new file mode 100644 index 0000000000..45325eeede --- /dev/null +++ b/tests/schemas/events_discovery/discovery_node.json @@ -0,0 +1,245 @@ +{ + "timestamp": "2024-11-21T12:10:46Z", + "version": "1.5.1", + "generation": "2024-11-21T12:09:30Z", + "scan_family": "bacnet", + "scan_addr": "10117", + "event_no": 9, + "families": { + "ipv4": { + "addr": "192.168.1.131" + } + }, + "refs": { + "AI:1": { + "name": "FCU_1180 Room Temp", + "possible_values": [], + "units": "degreesCelsius", + "description": "", + "ancillary": { + "present_value": 20.488115310668945 + } + }, + "AI:2": { + "name": "FCU_1180 Supply Air Temp", + "possible_values": [], + "units": "degreesCelsius", + "description": "", + "ancillary": { + "present_value": 20.14183235168457 + } + }, + "AO:1": { + "name": "FCU_1180 Heating Valve", + "possible_values": [], + "units": "percent", + "description": "", + "ancillary": { + "present_value": 0.0 + } + }, + "AO:2": { + "name": "FCU_1180 Cooling Valve", + "possible_values": [], + "units": "percent", + "description": "", + "ancillary": { + "present_value": 0.0 + } + }, + "AO:3": { + "name": "FCU_1180 Fan Speed", + "possible_values": [], + "units": "percent", + "description": "", + "ancillary": { + "present_value": 70.0 + } + }, + "AV:1": { + "name": "FCU_1180 Setpoint", + "possible_values": [], + "units": "degreesCelsius", + "description": "", + "ancillary": { + "present_value": 20.0 + } + }, + "AV:2": { + "name": "FCU_1180 Min Fan Speed", + "possible_values": [], + "units": "percent", + "description": "", + "ancillary": { + "present_value": 20.0 + } + }, + "AV:3": { + "name": "FCU_1180 Max Fan Speed", + "possible_values": [], + "units": "percent", + "description": "", + "ancillary": { + "present_value": 100.0 + } + }, + "AV:4": { + "name": "FCU_1180 Design Fan Speed", + "possible_values": [], + "units": "percent", + "description": "", + "ancillary": { + "present_value": 70.0 + } + }, + "AV:5": { + "name": "FCU_1180 Design Heating Valve Position", + "possible_values": [], + "units": "percent", + "description": "", + "ancillary": { + "present_value": 75.0 + } + }, + "AV:6": { + "name": "FCU_1180 Design Cooling Valve Position", + "possible_values": [], + "units": "percent", + "description": "", + "ancillary": { + "present_value": 67.0 + } + }, + "AV:7": { + "name": "FCU_1180 Mode_Mimic", + "possible_values": [], + "units": "noUnits", + "description": "", + "ancillary": { + "present_value": 1.0 + } + }, + "AV:9991": { + "name": "FCU_1180 Comfort KPI Score (Live)", + "possible_values": [], + "units": "percent", + "description": "", + "ancillary": { + "present_value": 69.89265441894531 + } + }, + "AV:9992": { + "name": "FCU_1180 Comfort KPI Score (Yesterday)", + "possible_values": [], + "units": "percent", + "description": "", + "ancillary": { + "present_value": 69.99639129638672 + } + }, + "BI:3": { + "name": "FCU_1180 Fan Status", + "possible_values": [], + "description": "", + "ancillary": { + "present_value": "active" + } + }, + "BI:4": { + "name": "FCU_1180 Occupancy", + "possible_values": [], + "description": "", + "ancillary": { + "present_value": "active" + } + }, + "BO:4": { + "name": "FCU_1180 Enable", + "possible_values": [], + "description": "", + "ancillary": { + "present_value": "active" + } + }, + "BV:1": { + "name": "FCU_1180 BMS Remote", + "possible_values": [], + "description": "", + "ancillary": { + "present_value": "active" + } + }, + "BV:2": { + "name": "FCU_1180 FCU Run Status", + "possible_values": [], + "description": "", + "ancillary": { + "present_value": "active" + } + }, + "BV:9991": { + "name": "FCU_1180 Within Bounds", + "possible_values": [], + "description": "", + "ancillary": { + "present_value": "active" + } + }, + "MSV:1": { + "name": "FCU_1180 Mode", + "possible_values": [ + "Auto_", + "On_", + "Off_", + "Flushing_", + "Commissioning_" + ], + "description": "", + "ancillary": { + "present_value": 1 + } + }, + "LP:1": { + "name": "FCU_101 Valve Control Loop", + "possible_values": [], + "description": "", + "ancillary": { + "present_value": 50.0 + } + }, + "LP:2": { + "name": "FCU_101 Fan Control Loop", + "possible_values": [], + "description": "", + "ancillary": { + "present_value": 50.0 + } + }, + "CSV:1": { + "name": "Google Cloud IoT Gateway Configuration", + "possible_values": [], + "description": "", + "ancillary": { + "present_value": "{\n \"hostName\": \"mqtt.bos.goog\",\n \"tcpPort\": 8883,\n \"location\": \"us-central1\",\n \"project\": \"bos-platform-testing\",\n \"registry\": \"UK-LON-GLAB\",\n \"device\": \"DDC-17\"\n}" + } + }, + "CSV:1000001": { + "name": "BLE PIN", + "possible_values": [], + "description": "", + "ancillary": { + "present_value": "800700" + } + } + }, + "system": { + "serial_no": "141557/0009", + "ancillary": { + "name": "DDC-17" + }, + "hardware": { + "make": "Delta Controls Inc.", + "model": "Red5-PLUS-1180" + } + } +} diff --git a/tests/schemas/events_discovery/discoverynode.out b/tests/schemas/events_discovery/discovery_node.out similarity index 100% rename from tests/schemas/events_discovery/discoverynode.out rename to tests/schemas/events_discovery/discovery_node.out diff --git a/tests/schemas/events_discovery/discoverynode.json b/tests/schemas/events_discovery/discoverynode.json deleted file mode 100644 index c96ab7a58b..0000000000 --- a/tests/schemas/events_discovery/discoverynode.json +++ /dev/null @@ -1 +0,0 @@ -{"timestamp":"2024-11-21T12:10:46Z","version":"1.5.1","generation":"2024-11-21T12:09:30Z","scan_family":"bacnet","scan_addr":"10117","event_no":9,"families":{"ipv4":{"addr":"192.168.1.131"}},"refs":{"AI:1":{"name":"FCU_1180 Room Temp","possible_values":[],"units":"degreesCelsius","description":"","ancillary":{"present_value":20.488115310668945}},"AI:2":{"name":"FCU_1180 Supply Air Temp","possible_values":[],"units":"degreesCelsius","description":"","ancillary":{"present_value":20.14183235168457}},"AO:1":{"name":"FCU_1180 Heating Valve","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":0.0}},"AO:2":{"name":"FCU_1180 Cooling Valve","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":0.0}},"AO:3":{"name":"FCU_1180 Fan Speed","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":70.0}},"AV:1":{"name":"FCU_1180 Setpoint","possible_values":[],"units":"degreesCelsius","description":"","ancillary":{"present_value":20.0}},"AV:2":{"name":"FCU_1180 Min Fan Speed","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":20.0}},"AV:3":{"name":"FCU_1180 Max Fan Speed","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":100.0}},"AV:4":{"name":"FCU_1180 Design Fan Speed","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":70.0}},"AV:5":{"name":"FCU_1180 Design Heating Valve Position","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":75.0}},"AV:6":{"name":"FCU_1180 Design Cooling Valve Position","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":67.0}},"AV:7":{"name":"FCU_1180 Mode_Mimic","possible_values":[],"units":"noUnits","description":"","ancillary":{"present_value":1.0}},"AV:9991":{"name":"FCU_1180 Comfort KPI Score (Live)","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":69.89265441894531}},"AV:9992":{"name":"FCU_1180 Comfort KPI Score (Yesterday)","possible_values":[],"units":"percent","description":"","ancillary":{"present_value":69.99639129638672}},"BI:3":{"name":"FCU_1180 Fan Status","possible_values":[],"description":"","ancillary":{"present_value":"active"}},"BI:4":{"name":"FCU_1180 Occupancy","possible_values":[],"description":"","ancillary":{"present_value":"active"}},"BO:4":{"name":"FCU_1180 Enable","possible_values":[],"description":"","ancillary":{"present_value":"active"}},"BV:1":{"name":"FCU_1180 BMS Remote","possible_values":[],"description":"","ancillary":{"present_value":"active"}},"BV:2":{"name":"FCU_1180 FCU Run Status","possible_values":[],"description":"","ancillary":{"present_value":"active"}},"BV:9991":{"name":"FCU_1180 Within Bounds","possible_values":[],"description":"","ancillary":{"present_value":"active"}},"MSV:1":{"name":"FCU_1180 Mode","possible_values":["Auto_","On_","Off_","Flushing_","Commissioning_"],"description":"","ancillary":{"present_value":1}},"LP:1":{"name":"FCU_101 Valve Control Loop","possible_values":[],"description":"","ancillary":{"present_value":50.0}},"LP:2":{"name":"FCU_101 Fan Control Loop","possible_values":[],"description":"","ancillary":{"present_value":50.0}},"CSV:1":{"name":"Google Cloud IoT Gateway Configuration","possible_values":[],"description":"","ancillary":{"present_value":"{\n \"hostName\": \"mqtt.bos.goog\",\n \"tcpPort\": 8883,\n \"location\": \"us-central1\",\n \"project\": \"bos-platform-testing\",\n \"registry\": \"UK-LON-GLAB\",\n \"device\": \"DDC-17\"\n}"}},"CSV:1000001":{"name":"BLE PIN","possible_values":[],"description":"","ancillary":{"present_value":"800700"}}},"system":{"serial_no":"141557/0009","ancillary":{"name":"DDC-17"},"hardware":{"make":"Delta Controls Inc.","model":"Red5-PLUS-1180"}}} \ No newline at end of file From 94f6042b46faf7a5489ce50eb196c059dee742cf Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 22 Nov 2024 09:50:35 -0800 Subject: [PATCH 03/15] Adding TODO TAP markers --- .../main/java/com/google/udmi/util/CommandLineProcessor.java | 3 ++- .../src/main/java/com/google/daq/mqtt/validator/Validator.java | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/google/udmi/util/CommandLineProcessor.java b/common/src/main/java/com/google/udmi/util/CommandLineProcessor.java index 8608ef4b2b..621f0a8980 100644 --- a/common/src/main/java/com/google/udmi/util/CommandLineProcessor.java +++ b/common/src/main/java/com/google/udmi/util/CommandLineProcessor.java @@ -1,6 +1,7 @@ package com.google.udmi.util; import static com.google.common.base.Preconditions.checkState; +import static com.google.udmi.util.GeneralUtils.friendlyStackTrace; import static com.google.udmi.util.GeneralUtils.ifNotNullThen; import static java.lang.String.CASE_INSENSITIVE_ORDER; import static java.util.Objects.nonNull; @@ -119,7 +120,7 @@ public List processArgs(List argList) { } return null; } catch (Exception e) { - showUsage(e.getMessage()); + showUsage(friendlyStackTrace(e)); return null; } } diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java b/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java index 3142612748..9fd0dd326a 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java @@ -810,6 +810,7 @@ private boolean processExceptions(Map attributes, String deviceI */ public void validateDeviceMessage(ReportingDevice device, Map message, Map attributes) { + // TODO: TAP combine this with other validation point String schemaName = messageSchema(attributes); upgradeMessage(schemaName, message); @@ -1252,6 +1253,7 @@ private void validateFile( outputStream.close(); FileUtils.copyFile(inputFile, outputFile); } + // TODO: TAP this as common inflection point? validateJsonNode(schema, jsonNode); writeExceptionOutput(targetOut, null); } catch (Exception e) { @@ -1304,6 +1306,7 @@ private void upgradeMessage(String schemaName, Map message) { } private void validateJsonNode(JsonSchema schema, JsonNode jsonNode) throws ProcessingException { + // TODO: TAP combine this is validation routine used by sequencer ProcessingReport report = schema.validate(jsonNode, true); ifTrueThen(!report.isSuccess(), () -> ifNotNullThrow(fromProcessingReport(report))); } From 7c42648afcfea861766a364919e5202bbb1f6c6e Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 22 Nov 2024 14:08:17 -0800 Subject: [PATCH 04/15] Consolidation validation paths --- .../google/daq/mqtt/util/ExceptionList.java | 15 ++++++++ .../daq/mqtt/validator/ReportingDevice.java | 24 ++++++++++-- .../google/daq/mqtt/validator/Validator.java | 38 ++++++++++++++----- 3 files changed, 64 insertions(+), 13 deletions(-) create mode 100644 common/src/main/java/com/google/daq/mqtt/util/ExceptionList.java diff --git a/common/src/main/java/com/google/daq/mqtt/util/ExceptionList.java b/common/src/main/java/com/google/daq/mqtt/util/ExceptionList.java new file mode 100644 index 0000000000..c37fccdfa6 --- /dev/null +++ b/common/src/main/java/com/google/daq/mqtt/util/ExceptionList.java @@ -0,0 +1,15 @@ +package com.google.daq.mqtt.util; + +import static java.lang.String.format; + +import java.util.List; + +public class ExceptionList extends RuntimeException { + + private final List list; + + public ExceptionList(List list) { + super(format("List of %d exceptions", list.size())); + this.list = list; + } +} diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/ReportingDevice.java b/validator/src/main/java/com/google/daq/mqtt/validator/ReportingDevice.java index fefa01b96f..d35712326b 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/ReportingDevice.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/ReportingDevice.java @@ -2,10 +2,12 @@ import static com.google.udmi.util.Common.SUBFOLDER_PROPERTY_KEY; import static com.google.udmi.util.Common.SUBTYPE_PROPERTY_KEY; +import static java.lang.String.format; import static java.util.Optional.ofNullable; import static org.junit.Assert.assertTrue; import com.google.common.base.Joiner; +import com.google.daq.mqtt.util.ExceptionList; import com.google.daq.mqtt.util.ValidationException; import com.google.udmi.util.Common; import java.time.Instant; @@ -39,6 +41,7 @@ public class ReportingDevice { private static Date mockNow; private final String deviceId; private final List entries = new ArrayList<>(); + private final Map entryExceptions = new HashMap<>(); private final List messageEntries = new ArrayList<>(); private final Map messageMarks = new HashMap<>(); private Date lastSeen = new Date(0); // Always defined, just start a long time ago! @@ -228,7 +231,7 @@ public void updateLastSeen(Date timestamp) { private Exception pointValidationError(String description, Set points) { return new ValidationException( - String.format("Device has %s: %s", description, Joiner.on(", ").join(points))); + format("Device has %s: %s", description, Joiner.on(", ").join(points))); } private void addEntry(Entry entry) { @@ -250,16 +253,18 @@ void addError(Exception error, Map attributes, String category) String subFolder = attributes.get(SUBFOLDER_PROPERTY_KEY); String subType = attributes.get(SUBTYPE_PROPERTY_KEY); addError(error, category, - String.format("%s: %s", typeFolderPairKey(subType, subFolder), + format("%s: %s", typeFolderPairKey(subType, subFolder), Common.getExceptionDetail(error, this.getClass(), ReportingDevice::validationMessage))); } void addError(Exception error, String category, String detail) { - addEntry(makeEntry(error, category, detail)); + Entry entry = makeEntry(error, category, detail); + entryExceptions.put(entry, error); + addEntry(entry); } public static String typeFolderPairKey(String subType, String subFolder) { - return String.format("%s_%s", ofNullable(subType).orElse(SubType.EVENTS.value()), subFolder); + return format("%s_%s", ofNullable(subType).orElse(SubType.EVENTS.value()), subFolder); } /** @@ -344,6 +349,17 @@ public List getMessageEntries() { return messageEntries; } + public void throwIfFailure() { + if (!hasErrors()) { + return; + } + if (messageEntries.size() == 1) { + throw (RuntimeException) entryExceptions.get(messageEntries.get(0)); + } + List exceptions = entries.stream().map(entry -> entryExceptions.get(entry)).toList(); + throw new ExceptionList(exceptions); + } + /** * Encapsulation of metadata differences. */ diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java b/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java index 9fd0dd326a..f8b469ddc9 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java @@ -11,6 +11,7 @@ import static com.google.daq.mqtt.util.ConfigUtil.readExeConfig; import static com.google.daq.mqtt.util.PubSubClient.getFeedInfo; import static com.google.daq.mqtt.validator.ReportingDevice.typeFolderPairKey; +import static com.google.udmi.util.Common.DEVICE_ID_KEY; import static com.google.udmi.util.Common.ERROR_KEY; import static com.google.udmi.util.Common.EXCEPTION_KEY; import static com.google.udmi.util.Common.EXIT_CODE_ERROR; @@ -104,6 +105,7 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.regex.Pattern; @@ -186,8 +188,11 @@ public class Validator { private static final int TIMESTAMP_JITTER_SEC = 60; private static final String UDMI_CONFIG_JSON_FILE = "udmi_config.json"; private static final String TOOL_NAME = "validator"; - public static final String VALIDATOR_TOOL_NAME = "validator"; - public static final String REGISTRY_DEVICE_DEFAULT = "_regsitry"; + private static final String FAUX_DEVICE_ID = "TEST-97"; + private static final String FAUX_REGISTRY_ID = "ZZ-TEST-REG"; + private static final String VALIDATOR_TOOL_NAME = "validator"; + private static final String REGISTRY_DEVICE_DEFAULT = "_regsitry"; + private static final String IGNORE_ENVELOPE = "ignore_envelope"; private long reportingDelaySec = DEFAULT_INTERVAL_SEC; private final CommandLineProcessor commandLineProcessor = new CommandLineProcessor(this); private final Map reportingDevices = new TreeMap<>(); @@ -814,11 +819,13 @@ public void validateDeviceMessage(ReportingDevice device, Map me String schemaName = messageSchema(attributes); upgradeMessage(schemaName, message); - try { - validateMessage(schemaMap.get(ENVELOPE_SCHEMA_ID), (Object) attributes); - } catch (Exception e) { - outputLogger.error("Error validating attributes: " + friendlyStackTrace(e)); - device.addError(e, attributes, Category.VALIDATION_DEVICE_RECEIVE); + if (!attributes.containsKey(IGNORE_ENVELOPE)) { + try { + validateMessage(schemaMap.get(ENVELOPE_SCHEMA_ID), (Object) attributes); + } catch (Exception e) { + outputLogger.error("Error validating attributes: " + friendlyStackTrace(e)); + device.addError(e, attributes, Category.VALIDATION_DEVICE_RECEIVE); + } } if (schemaMap.containsKey(schemaName)) { @@ -1240,6 +1247,7 @@ private void validateFile( final File targetOut = getOutputPath(prefix, targetFile.replace(".json", ".out")); File outputFile = getOutputPath(prefix, targetFile); File inputFile = new File(targetFile); + AtomicReference exceptionOut = new AtomicReference<>(); try (OutputStream outputStream = Files.newOutputStream(outputFile.toPath())) { copyFileHeader(inputFile, outputStream); Map message = JsonUtil.loadMap(inputFile); @@ -1253,8 +1261,9 @@ private void validateFile( outputStream.close(); FileUtils.copyFile(inputFile, outputFile); } - // TODO: TAP this as common inflection point? - validateJsonNode(schema, jsonNode); + ReportingDevice reportingDevice = new ReportingDevice(FAUX_DEVICE_ID); + validateDeviceMessage(reportingDevice, message, makeFileAttributes(schemaName)); + reportingDevice.throwIfFailure(); writeExceptionOutput(targetOut, null); } catch (Exception e) { writeExceptionOutput(targetOut, e); @@ -1262,6 +1271,17 @@ private void validateFile( } } + private Map makeFileAttributes(String schemaName) { + HashMap attributes = new HashMap<>(); + attributes.put(DEVICE_ID_KEY, FAUX_DEVICE_ID); + String[] parts = schemaName.split("_"); + attributes.put(SUBTYPE_PROPERTY_KEY, parts[0]); + attributes.put(SUBFOLDER_PROPERTY_KEY, parts.length < 2 ? null : parts[1]); + attributes.put(DEVICE_REGISTRY_ID_KEY, FAUX_REGISTRY_ID); + attributes.put(IGNORE_ENVELOPE, schemaName); + return attributes; + } + private void copyFileHeader(File inputFile, OutputStream outputFile) { try (Scanner scanner = new Scanner(inputFile)) { while (scanner.hasNextLine()) { From 88aff89814d2505fd377a326ec184acadddb3a4c Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 22 Nov 2024 14:29:21 -0800 Subject: [PATCH 05/15] Fixing for metadata/model crazy --- .../google/daq/mqtt/validator/Validator.java | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java b/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java index f8b469ddc9..1b79ffbbe2 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java @@ -189,10 +189,9 @@ public class Validator { private static final String UDMI_CONFIG_JSON_FILE = "udmi_config.json"; private static final String TOOL_NAME = "validator"; private static final String FAUX_DEVICE_ID = "TEST-97"; - private static final String FAUX_REGISTRY_ID = "ZZ-TEST-REG"; private static final String VALIDATOR_TOOL_NAME = "validator"; private static final String REGISTRY_DEVICE_DEFAULT = "_regsitry"; - private static final String IGNORE_ENVELOPE = "ignore_envelope"; + private static final String SCHEMA_NAME_KEY = "ignore_envelope"; private long reportingDelaySec = DEFAULT_INTERVAL_SEC; private final CommandLineProcessor commandLineProcessor = new CommandLineProcessor(this); private final Map reportingDevices = new TreeMap<>(); @@ -563,8 +562,8 @@ private Map getSchemaMap() { throw new RuntimeException("Missing schema for attribute validation: " + ENVELOPE_SCHEMA_ID); } - // Rename the metadata schema to model, which is how it's handled programmatically. - schemaMap.put("model", schemaMap.remove("metadata")); + // Copy the metadata schema to model, since sometimes it's referenced that way. + schemaMap.put("model", schemaMap.get("metadata")); return schemaMap; } @@ -815,11 +814,11 @@ private boolean processExceptions(Map attributes, String deviceI */ public void validateDeviceMessage(ReportingDevice device, Map message, Map attributes) { - // TODO: TAP combine this with other validation point - String schemaName = messageSchema(attributes); + String schemaName = ofNullable(attributes.get(SCHEMA_NAME_KEY)).orElseGet(() -> messageSchema(attributes)); upgradeMessage(schemaName, message); - if (!attributes.containsKey(IGNORE_ENVELOPE)) { + // Assume the attributes know what they're doing when the schema name is provided explicitly. + if (!attributes.containsKey(SCHEMA_NAME_KEY)) { try { validateMessage(schemaMap.get(ENVELOPE_SCHEMA_ID), (Object) attributes); } catch (Exception e) { @@ -1273,12 +1272,7 @@ private void validateFile( private Map makeFileAttributes(String schemaName) { HashMap attributes = new HashMap<>(); - attributes.put(DEVICE_ID_KEY, FAUX_DEVICE_ID); - String[] parts = schemaName.split("_"); - attributes.put(SUBTYPE_PROPERTY_KEY, parts[0]); - attributes.put(SUBFOLDER_PROPERTY_KEY, parts.length < 2 ? null : parts[1]); - attributes.put(DEVICE_REGISTRY_ID_KEY, FAUX_REGISTRY_ID); - attributes.put(IGNORE_ENVELOPE, schemaName); + attributes.put(SCHEMA_NAME_KEY, schemaName); return attributes; } From e6829eb37f0e9c63073989bfc62d5c90b74fbd7d Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 22 Nov 2024 14:29:48 -0800 Subject: [PATCH 06/15] Adjusting schema out --- .../schemas/commands_discovery/provision.out | 5 +++-- .../config/blobset_final_incomplete_url.out | 5 +++-- tests/schemas/config/delta_x1_gateway.out | 7 ++++--- tests/schemas/config/delta_x1_target.out | 7 ++++--- tests/schemas/config/empty.out | 5 +++-- tests/schemas/config/errors.out | 15 ++++++++------- tests/schemas/config/fcu.out | 7 ++++--- tests/schemas/config/gateway.out | 5 +++-- tests/schemas/config/smartprimus.out | 7 ++++--- .../configuration_endpoint/multiple.out | 5 +++-- tests/schemas/envelope/empty.out | 5 +++-- tests/schemas/envelope/errors1.out | 11 ++++++----- tests/schemas/envelope/errors2.out | 7 ++++--- tests/schemas/events_discovery/empty.out | 5 +++-- tests/schemas/events_discovery/errors.out | 13 +++++++------ tests/schemas/events_discovery/node.out | 5 +++-- tests/schemas/events_mapping/prediction.out | 5 +++-- tests/schemas/events_pointset/empty.out | 5 +++-- tests/schemas/events_pointset/errors.out | 19 ++++++++++--------- tests/schemas/events_system/categories.out | 15 ++++++++------- tests/schemas/events_system/empty.out | 5 +++-- tests/schemas/events_system/errors.out | 11 ++++++----- tests/schemas/metadata/bad.out | 7 ++++--- tests/schemas/metadata/empty.out | 5 +++-- tests/schemas/metadata/errors.out | 17 +++++++++-------- tests/schemas/metadata/nosys.out | 5 +++-- tests/schemas/metadata/toomany.out | 7 ++++--- tests/schemas/site_metadata/errors.out | 9 +++++---- tests/schemas/state/delta_x1_gateway.out | 11 ++++++----- tests/schemas/state/delta_x1_target.out | 7 ++++--- tests/schemas/state/empty.out | 5 +++-- tests/schemas/state/errors.out | 15 ++++++++------- tests/schemas/state/makemodel_error.out | 7 ++++--- tests/schemas/state/scan_bad.out | 5 +++-- 34 files changed, 154 insertions(+), 120 deletions(-) diff --git a/tests/schemas/commands_discovery/provision.out b/tests/schemas/commands_discovery/provision.out index 822eaae055..19183398e3 100644 --- a/tests/schemas/commands_discovery/provision.out +++ b/tests/schemas/commands_discovery/provision.out @@ -1,2 +1,3 @@ -1 schema violations found - object instance has properties which are not allowed by the schema: ["provision"] +While converting to json node: 1 schema violations found + 1 schema violations found + object instance has properties which are not allowed by the schema: ["provision"] diff --git a/tests/schemas/config/blobset_final_incomplete_url.out b/tests/schemas/config/blobset_final_incomplete_url.out index b97f30ec93..309b00389e 100644 --- a/tests/schemas/config/blobset_final_incomplete_url.out +++ b/tests/schemas/config/blobset_final_incomplete_url.out @@ -1,2 +1,3 @@ -1 schema violations found - /blobset/blobs/_firmware_update: object has missing required properties (["generation","sha256"]) +While converting to json node: 1 schema violations found + 1 schema violations found + /blobset/blobs/_firmware_update: object has missing required properties (["generation","sha256"]) diff --git a/tests/schemas/config/delta_x1_gateway.out b/tests/schemas/config/delta_x1_gateway.out index ac8fda8b39..39e4af0ebf 100644 --- a/tests/schemas/config/delta_x1_gateway.out +++ b/tests/schemas/config/delta_x1_gateway.out @@ -1,3 +1,4 @@ -2 schema violations found - /localnet: object instance has properties which are not allowed by the schema: ["subsystem"] - object has missing required properties (["version"]) +While converting to json node: 2 schema violations found + 2 schema violations found + /localnet: object instance has properties which are not allowed by the schema: ["subsystem"] + object has missing required properties (["version"]) diff --git a/tests/schemas/config/delta_x1_target.out b/tests/schemas/config/delta_x1_target.out index ac8fda8b39..39e4af0ebf 100644 --- a/tests/schemas/config/delta_x1_target.out +++ b/tests/schemas/config/delta_x1_target.out @@ -1,3 +1,4 @@ -2 schema violations found - /localnet: object instance has properties which are not allowed by the schema: ["subsystem"] - object has missing required properties (["version"]) +While converting to json node: 2 schema violations found + 2 schema violations found + /localnet: object instance has properties which are not allowed by the schema: ["subsystem"] + object has missing required properties (["version"]) diff --git a/tests/schemas/config/empty.out b/tests/schemas/config/empty.out index 6b478b7302..a43a45d0df 100644 --- a/tests/schemas/config/empty.out +++ b/tests/schemas/config/empty.out @@ -1,2 +1,3 @@ -1 schema violations found - object has missing required properties (["timestamp","version"]) +While converting to json node: 1 schema violations found + 1 schema violations found + object has missing required properties (["timestamp","version"]) diff --git a/tests/schemas/config/errors.out b/tests/schemas/config/errors.out index e2c83487a7..633b4bfd99 100644 --- a/tests/schemas/config/errors.out +++ b/tests/schemas/config/errors.out @@ -1,7 +1,8 @@ -6 schema violations found - /pointset/points/return_air_temperature_sensor: object instance has properties which are not allowed by the schema: ["object_type"] - /pointset/sample_rate_sec: instance type (string) does not match any allowed primitive type (allowed: ["integer"]) - /pointset/state_etag: string "2a8b71dwqhdhdddddddddddddddddddddddddddddddddddddddddd8" is too long (length: 55, maximum allowed: 32) - /pointset/version: instance type (integer) does not match any allowed primitive type (allowed: ["string"]) - /pointset: object instance has properties which are not allowed by the schema: ["config_etag","id","properties"] - object instance has properties which are not allowed by the schema: ["points","properties","type","upgraded_from"] +While converting to json node: 6 schema violations found + 6 schema violations found + /pointset/points/return_air_temperature_sensor: object instance has properties which are not allowed by the schema: ["object_type"] + /pointset/sample_rate_sec: instance type (string) does not match any allowed primitive type (allowed: ["integer"]) + /pointset/state_etag: string "2a8b71dwqhdhdddddddddddddddddddddddddddddddddddddddddd8" is too long (length: 55, maximum allowed: 32) + /pointset/version: instance type (integer) does not match any allowed primitive type (allowed: ["string"]) + /pointset: object instance has properties which are not allowed by the schema: ["config_etag","id","properties"] + object instance has properties which are not allowed by the schema: ["points","properties","type","upgraded_from"] diff --git a/tests/schemas/config/fcu.out b/tests/schemas/config/fcu.out index cedf4f9585..a314ba1ff2 100644 --- a/tests/schemas/config/fcu.out +++ b/tests/schemas/config/fcu.out @@ -1,3 +1,4 @@ -2 schema violations found - /pointset/points/chilled_water_valve_percentage_command: object instance has properties which are not allowed by the schema: ["min_update_ms"] - /system: object instance has properties which are not allowed by the schema: ["max_update_ms"] +While converting to json node: 2 schema violations found + 2 schema violations found + /pointset/points/chilled_water_valve_percentage_command: object instance has properties which are not allowed by the schema: ["min_update_ms"] + /system: object instance has properties which are not allowed by the schema: ["max_update_ms"] diff --git a/tests/schemas/config/gateway.out b/tests/schemas/config/gateway.out index a66518e068..e453808440 100644 --- a/tests/schemas/config/gateway.out +++ b/tests/schemas/config/gateway.out @@ -1,2 +1,3 @@ -1 schema violations found - /gateway/proxy_ids/2: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "991" +While converting to json node: 1 schema violations found + 1 schema violations found + /gateway/proxy_ids/2: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "991" diff --git a/tests/schemas/config/smartprimus.out b/tests/schemas/config/smartprimus.out index c06af5362a..cbad7ad3b7 100644 --- a/tests/schemas/config/smartprimus.out +++ b/tests/schemas/config/smartprimus.out @@ -1,3 +1,4 @@ -2 schema violations found - /pointset/points/fan_run_enable: object instance has properties which are not allowed by the schema: ["fix_value"] - /pointset/points/fan_run_status: object instance has properties which are not allowed by the schema: ["fix_value"] +While converting to json node: 2 schema violations found + 2 schema violations found + /pointset/points/fan_run_enable: object instance has properties which are not allowed by the schema: ["fix_value"] + /pointset/points/fan_run_status: object instance has properties which are not allowed by the schema: ["fix_value"] diff --git a/tests/schemas/configuration_endpoint/multiple.out b/tests/schemas/configuration_endpoint/multiple.out index 7b0b39a451..28d8793a11 100644 --- a/tests/schemas/configuration_endpoint/multiple.out +++ b/tests/schemas/configuration_endpoint/multiple.out @@ -1,2 +1,3 @@ -1 schema violations found - /topic_prefix: ECMA 262 regex "^[-_/a-zA-Z0-9]+$" does not match input string "/devices/#" +While converting to json node: 1 schema violations found + 1 schema violations found + /topic_prefix: ECMA 262 regex "^[-_/a-zA-Z0-9]+$" does not match input string "/devices/#" diff --git a/tests/schemas/envelope/empty.out b/tests/schemas/envelope/empty.out index 411a14b17c..5e0a72685d 100644 --- a/tests/schemas/envelope/empty.out +++ b/tests/schemas/envelope/empty.out @@ -1,2 +1,3 @@ -1 schema violations found - object has missing required properties (["deviceRegistryId"]) +While converting to json node: 1 schema violations found + 1 schema violations found + object has missing required properties (["deviceRegistryId"]) diff --git a/tests/schemas/envelope/errors1.out b/tests/schemas/envelope/errors1.out index e149c3adfd..6d75a25093 100644 --- a/tests/schemas/envelope/errors1.out +++ b/tests/schemas/envelope/errors1.out @@ -1,5 +1,6 @@ -4 schema violations found - /deviceId: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "fcu-1" - /deviceNumId: ECMA 262 regex "^[0-9]+$" does not match input string "921302198324X" - /deviceRegistryId: ECMA 262 regex "^[a-zA-Z][-a-zA-Z0-9._+~%]*[a-zA-Z0-9]$" does not match input string "test/registry" - /subType: instance value (5) not found in enum (possible values: ["invalid","reflect","events","errors","commands","config","state","query","reply","model"]) +While converting to json node: 4 schema violations found + 4 schema violations found + /deviceId: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "fcu-1" + /deviceNumId: ECMA 262 regex "^[0-9]+$" does not match input string "921302198324X" + /deviceRegistryId: ECMA 262 regex "^[a-zA-Z][-a-zA-Z0-9._+~%]*[a-zA-Z0-9]$" does not match input string "test/registry" + /subType: instance value (5) not found in enum (possible values: ["invalid","reflect","events","errors","commands","config","state","query","reply","model"]) diff --git a/tests/schemas/envelope/errors2.out b/tests/schemas/envelope/errors2.out index a903995aa1..00375e8533 100644 --- a/tests/schemas/envelope/errors2.out +++ b/tests/schemas/envelope/errors2.out @@ -1,3 +1,4 @@ -2 schema violations found - /deviceId: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "FCUs_02_NW_12" - /deviceNumId: ECMA 262 regex "^[0-9]+$" does not match input string "-9213923812" +While converting to json node: 2 schema violations found + 2 schema violations found + /deviceId: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "FCUs_02_NW_12" + /deviceNumId: ECMA 262 regex "^[0-9]+$" does not match input string "-9213923812" diff --git a/tests/schemas/events_discovery/empty.out b/tests/schemas/events_discovery/empty.out index 17f84d9366..88fabcd688 100644 --- a/tests/schemas/events_discovery/empty.out +++ b/tests/schemas/events_discovery/empty.out @@ -1,2 +1,3 @@ -1 schema violations found - object has missing required properties (["scan_family","timestamp","version"]) +While converting to json node: 1 schema violations found + 1 schema violations found + object has missing required properties (["scan_family","timestamp","version"]) diff --git a/tests/schemas/events_discovery/errors.out b/tests/schemas/events_discovery/errors.out index 89e23f0747..4640defbd2 100644 --- a/tests/schemas/events_discovery/errors.out +++ b/tests/schemas/events_discovery/errors.out @@ -1,6 +1,7 @@ -5 schema violations found - /families/bacnet: object has missing required properties (["addr"]) - /families/bacnet: object instance has properties which are not allowed by the schema: ["id"] - /families/mac: object instance has properties which are not allowed by the schema: ["group"] - object has missing required properties (["scan_family"]) - object instance has properties which are not allowed by the schema: ["addr","id","points","uniqs"] +While converting to json node: 5 schema violations found + 5 schema violations found + /families/bacnet: object has missing required properties (["addr"]) + /families/bacnet: object instance has properties which are not allowed by the schema: ["id"] + /families/mac: object instance has properties which are not allowed by the schema: ["group"] + object has missing required properties (["scan_family"]) + object instance has properties which are not allowed by the schema: ["addr","id","points","uniqs"] diff --git a/tests/schemas/events_discovery/node.out b/tests/schemas/events_discovery/node.out index ba111b3d96..0d807b6d31 100644 --- a/tests/schemas/events_discovery/node.out +++ b/tests/schemas/events_discovery/node.out @@ -1,2 +1,3 @@ -1 schema violations found - /system: object instance has properties which are not allowed by the schema: ["software"] \ No newline at end of file +While converting to json node: 1 schema violations found + 1 schema violations found + /system: object instance has properties which are not allowed by the schema: ["software"] diff --git a/tests/schemas/events_mapping/prediction.out b/tests/schemas/events_mapping/prediction.out index 11a2bfe8cf..3a7aee5005 100644 --- a/tests/schemas/events_mapping/prediction.out +++ b/tests/schemas/events_mapping/prediction.out @@ -1,2 +1,3 @@ -1 schema violations found - object instance has properties which are not allowed by the schema: ["prediction"] +While converting to json node: 1 schema violations found + 1 schema violations found + object instance has properties which are not allowed by the schema: ["prediction"] diff --git a/tests/schemas/events_pointset/empty.out b/tests/schemas/events_pointset/empty.out index bdb09a111e..100298650d 100644 --- a/tests/schemas/events_pointset/empty.out +++ b/tests/schemas/events_pointset/empty.out @@ -1,2 +1,3 @@ -1 schema violations found - object has missing required properties (["points","timestamp","version"]) +While converting to json node: 1 schema violations found + 1 schema violations found + object has missing required properties (["points","timestamp","version"]) diff --git a/tests/schemas/events_pointset/errors.out b/tests/schemas/events_pointset/errors.out index 1e6047f3d7..b366f2ead1 100644 --- a/tests/schemas/events_pointset/errors.out +++ b/tests/schemas/events_pointset/errors.out @@ -1,9 +1,10 @@ -8 schema violations found - /points/guid: instance type (string) does not match any allowed primitive type (allowed: ["object"]) - /points/missing_present_value: object has missing required properties (["present_value"]) - /points/old_properties: object has missing required properties (["present_value"]) - /points/old_properties: object instance has properties which are not allowed by the schema: ["properties"] - /points/yoyo_motion_sensor: object has missing required properties (["present_value"]) - /points/yoyo_motion_sensor: object instance has properties which are not allowed by the schema: ["bad_property_name"] - /points: object instance has properties which are not allowed by the schema: ["analogValue_1","bad_____sensor","bad_entity_name_","comment$string"] - object instance has properties which are not allowed by the schema: ["comment$string","id","properties","state_etag"] +While converting to json node: 8 schema violations found + 8 schema violations found + /points/guid: instance type (string) does not match any allowed primitive type (allowed: ["object"]) + /points/missing_present_value: object has missing required properties (["present_value"]) + /points/old_properties: object has missing required properties (["present_value"]) + /points/old_properties: object instance has properties which are not allowed by the schema: ["properties"] + /points/yoyo_motion_sensor: object has missing required properties (["present_value"]) + /points/yoyo_motion_sensor: object instance has properties which are not allowed by the schema: ["bad_property_name"] + /points: object instance has properties which are not allowed by the schema: ["analogValue_1","bad_____sensor","bad_entity_name_","comment$string"] + object instance has properties which are not allowed by the schema: ["comment$string","id","properties","state_etag"] diff --git a/tests/schemas/events_system/categories.out b/tests/schemas/events_system/categories.out index 182878a8e6..a9b587920f 100644 --- a/tests/schemas/events_system/categories.out +++ b/tests/schemas/events_system/categories.out @@ -1,7 +1,8 @@ -6 schema violations found - /logentries/3/category: instance failed to match exactly one schema (matched 0 out of 37) - /logentries/4/category: instance failed to match exactly one schema (matched 0 out of 37) - /logentries/5/category: instance failed to match exactly one schema (matched 0 out of 37) - /logentries/6/category: instance failed to match exactly one schema (matched 0 out of 37) - /logentries/7/category: instance failed to match exactly one schema (matched 0 out of 37) - /logentries/9/category: instance failed to match exactly one schema (matched 0 out of 37) +While converting to json node: 6 schema violations found + 6 schema violations found + /logentries/3/category: instance failed to match exactly one schema (matched 0 out of 37) + /logentries/4/category: instance failed to match exactly one schema (matched 0 out of 37) + /logentries/5/category: instance failed to match exactly one schema (matched 0 out of 37) + /logentries/6/category: instance failed to match exactly one schema (matched 0 out of 37) + /logentries/7/category: instance failed to match exactly one schema (matched 0 out of 37) + /logentries/9/category: instance failed to match exactly one schema (matched 0 out of 37) diff --git a/tests/schemas/events_system/empty.out b/tests/schemas/events_system/empty.out index 6b478b7302..a43a45d0df 100644 --- a/tests/schemas/events_system/empty.out +++ b/tests/schemas/events_system/empty.out @@ -1,2 +1,3 @@ -1 schema violations found - object has missing required properties (["timestamp","version"]) +While converting to json node: 1 schema violations found + 1 schema violations found + object has missing required properties (["timestamp","version"]) diff --git a/tests/schemas/events_system/errors.out b/tests/schemas/events_system/errors.out index 96ea55c516..5f02a906bd 100644 --- a/tests/schemas/events_system/errors.out +++ b/tests/schemas/events_system/errors.out @@ -1,5 +1,6 @@ -4 schema violations found - /logentries/0/category: instance failed to match exactly one schema (matched 0 out of 37) - /logentries/0/level: numeric instance is lower than the required minimum (minimum: 100, found: 60) - /logentries/0: object has missing required properties (["message","timestamp"]) - /logentries/1: instance type (string) does not match any allowed primitive type (allowed: ["object"]) +While converting to json node: 4 schema violations found + 4 schema violations found + /logentries/0/category: instance failed to match exactly one schema (matched 0 out of 37) + /logentries/0/level: numeric instance is lower than the required minimum (minimum: 100, found: 60) + /logentries/0: object has missing required properties (["message","timestamp"]) + /logentries/1: instance type (string) does not match any allowed primitive type (allowed: ["object"]) diff --git a/tests/schemas/metadata/bad.out b/tests/schemas/metadata/bad.out index 71a1590d72..95d58b548b 100644 --- a/tests/schemas/metadata/bad.out +++ b/tests/schemas/metadata/bad.out @@ -1,3 +1,4 @@ -2 schema violations found - /gateway/proxy_ids/0: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "AHU-001" - /gateway/proxy_ids/1: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "A-1" +While converting to json node: 2 schema violations found + 2 schema violations found + /gateway/proxy_ids/0: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "AHU-001" + /gateway/proxy_ids/1: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "A-1" diff --git a/tests/schemas/metadata/empty.out b/tests/schemas/metadata/empty.out index be18dff0c5..17c7a41ff0 100644 --- a/tests/schemas/metadata/empty.out +++ b/tests/schemas/metadata/empty.out @@ -1,2 +1,3 @@ -1 schema violations found - object has missing required properties (["system","timestamp","version"]) +While converting to json node: 1 schema violations found + 1 schema violations found + object has missing required properties (["system","timestamp","version"]) diff --git a/tests/schemas/metadata/errors.out b/tests/schemas/metadata/errors.out index 5e04d07a5f..533c7eef9c 100644 --- a/tests/schemas/metadata/errors.out +++ b/tests/schemas/metadata/errors.out @@ -1,8 +1,9 @@ -7 schema violations found - /pointset/points/return_air_temperature_sensor: object instance has properties which are not allowed by the schema: ["monkeys"] - /pointset: object instance has properties which are not allowed by the schema: ["rabbits"] - /system/location/site: ECMA 262 regex "^[A-Z]{2}-[A-Z]{3,4}-[A-Z0-9]{2,9}$" does not match input string "New Zealand" - /system/physical_tag/asset/name: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "AHU-A01_extension11-option" - /system/physical_tag/asset/site: ECMA 262 regex "^[A-Z]{2}-[A-Z]{3,4}-[A-Z0-9]{2,9}$" does not match input string "US-SFO-XYY_Noope!" - /system/physical_tag/asset: object has missing required properties (["guid"]) - /system: object instance has properties which are not allowed by the schema: ["guid"] +While converting to json node: 7 schema violations found + 7 schema violations found + /pointset/points/return_air_temperature_sensor: object instance has properties which are not allowed by the schema: ["monkeys"] + /pointset: object instance has properties which are not allowed by the schema: ["rabbits"] + /system/location/site: ECMA 262 regex "^[A-Z]{2}-[A-Z]{3,4}-[A-Z0-9]{2,9}$" does not match input string "New Zealand" + /system/physical_tag/asset/name: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "AHU-A01_extension11-option" + /system/physical_tag/asset/site: ECMA 262 regex "^[A-Z]{2}-[A-Z]{3,4}-[A-Z0-9]{2,9}$" does not match input string "US-SFO-XYY_Noope!" + /system/physical_tag/asset: object has missing required properties (["guid"]) + /system: object instance has properties which are not allowed by the schema: ["guid"] diff --git a/tests/schemas/metadata/nosys.out b/tests/schemas/metadata/nosys.out index e7346293c0..0bbe4689b6 100644 --- a/tests/schemas/metadata/nosys.out +++ b/tests/schemas/metadata/nosys.out @@ -1,2 +1,3 @@ -1 schema violations found - object has missing required properties (["system"]) +While converting to json node: 1 schema violations found + 1 schema violations found + object has missing required properties (["system"]) diff --git a/tests/schemas/metadata/toomany.out b/tests/schemas/metadata/toomany.out index ccd0449403..b017e34774 100644 --- a/tests/schemas/metadata/toomany.out +++ b/tests/schemas/metadata/toomany.out @@ -1,3 +1,4 @@ -2 schema violations found - /pointset/points: object has too many properties (found 672 but schema requires at most 150) - /system/physical_tag/asset/name: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "UK-LON-S2_LTGW-3" +While converting to json node: 2 schema violations found + 2 schema violations found + /pointset/points: object has too many properties (found 672 but schema requires at most 150) + /system/physical_tag/asset/name: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "UK-LON-S2_LTGW-3" diff --git a/tests/schemas/site_metadata/errors.out b/tests/schemas/site_metadata/errors.out index f65310a0a8..4548c7565a 100644 --- a/tests/schemas/site_metadata/errors.out +++ b/tests/schemas/site_metadata/errors.out @@ -1,4 +1,5 @@ -3 schema violations found - /parameters/area/net_occupied_area/unit: instance failed to match exactly one schema (matched 0 out of 7) - /parameters/area: object instance has properties which are not allowed by the schema: ["extra"] - object has missing required properties (["timestamp"]) +While converting to json node: 3 schema violations found + 3 schema violations found + /parameters/area/net_occupied_area/unit: instance failed to match exactly one schema (matched 0 out of 7) + /parameters/area: object instance has properties which are not allowed by the schema: ["extra"] + object has missing required properties (["timestamp"]) diff --git a/tests/schemas/state/delta_x1_gateway.out b/tests/schemas/state/delta_x1_gateway.out index 3f6e25a6f4..f015b3eeca 100644 --- a/tests/schemas/state/delta_x1_gateway.out +++ b/tests/schemas/state/delta_x1_gateway.out @@ -1,5 +1,6 @@ -4 schema violations found - /gateway: object instance has properties which are not allowed by the schema: ["error_ids"] - /system/hardware: object has missing required properties (["make","model"]) - /system/hardware: object instance has properties which are not allowed by the schema: ["cpu_usage","free_dynamic_memory","last_reset_timestamp","last_restart_reason","reset_count","revision","total_dynamic_memory"] - object instance has properties which are not allowed by the schema: ["last_config"] +While converting to json node: 4 schema violations found + 4 schema violations found + /gateway: object instance has properties which are not allowed by the schema: ["error_ids"] + /system/hardware: object has missing required properties (["make","model"]) + /system/hardware: object instance has properties which are not allowed by the schema: ["cpu_usage","free_dynamic_memory","last_reset_timestamp","last_restart_reason","reset_count","revision","total_dynamic_memory"] + object instance has properties which are not allowed by the schema: ["last_config"] diff --git a/tests/schemas/state/delta_x1_target.out b/tests/schemas/state/delta_x1_target.out index 859981bfa1..d4aac02d41 100644 --- a/tests/schemas/state/delta_x1_target.out +++ b/tests/schemas/state/delta_x1_target.out @@ -1,3 +1,4 @@ -2 schema violations found - /system: object has missing required properties (["serial_no"]) - /system: object instance has properties which are not allowed by the schema: ["vendor_name"] +While converting to json node: 2 schema violations found + 2 schema violations found + /system: object has missing required properties (["serial_no"]) + /system: object instance has properties which are not allowed by the schema: ["vendor_name"] diff --git a/tests/schemas/state/empty.out b/tests/schemas/state/empty.out index be18dff0c5..17c7a41ff0 100644 --- a/tests/schemas/state/empty.out +++ b/tests/schemas/state/empty.out @@ -1,2 +1,3 @@ -1 schema violations found - object has missing required properties (["system","timestamp","version"]) +While converting to json node: 1 schema violations found + 1 schema violations found + object has missing required properties (["system","timestamp","version"]) diff --git a/tests/schemas/state/errors.out b/tests/schemas/state/errors.out index 28692d9343..47d4c6efc1 100644 --- a/tests/schemas/state/errors.out +++ b/tests/schemas/state/errors.out @@ -1,7 +1,8 @@ -6 schema violations found - /pointset/points/return_air_temperature_sensor/status: instance type (string) does not match any allowed primitive type (allowed: ["object"]) - /pointset/points/return_air_temperature_sensor: object instance has properties which are not allowed by the schema: ["cov_increment","deadband","high_limit","instance_number","low_limit","object_type","rapt","resolution"] - /system/status: instance type (string) does not match any allowed primitive type (allowed: ["object"]) - /system: object has missing required properties (["hardware","last_config","operation","serial_no","software"]) - /system: object instance has properties which are not allowed by the schema: ["device_id","device_status","fling","object_name","system_status"] - object instance has properties which are not allowed by the schema: ["id","status"] +While converting to json node: 6 schema violations found + 6 schema violations found + /pointset/points/return_air_temperature_sensor/status: instance type (string) does not match any allowed primitive type (allowed: ["object"]) + /pointset/points/return_air_temperature_sensor: object instance has properties which are not allowed by the schema: ["cov_increment","deadband","high_limit","instance_number","low_limit","object_type","rapt","resolution"] + /system/status: instance type (string) does not match any allowed primitive type (allowed: ["object"]) + /system: object has missing required properties (["hardware","last_config","operation","serial_no","software"]) + /system: object instance has properties which are not allowed by the schema: ["device_id","device_status","fling","object_name","system_status"] + object instance has properties which are not allowed by the schema: ["id","status"] diff --git a/tests/schemas/state/makemodel_error.out b/tests/schemas/state/makemodel_error.out index 779dc6ded7..995c903a60 100644 --- a/tests/schemas/state/makemodel_error.out +++ b/tests/schemas/state/makemodel_error.out @@ -1,3 +1,4 @@ -2 schema violations found - /system: object has missing required properties (["hardware","software"]) - /system: object instance has properties which are not allowed by the schema: ["firmware","make_model"] +While converting to json node: 2 schema violations found + 2 schema violations found + /system: object has missing required properties (["hardware","software"]) + /system: object instance has properties which are not allowed by the schema: ["firmware","make_model"] diff --git a/tests/schemas/state/scan_bad.out b/tests/schemas/state/scan_bad.out index 4e3842bea6..93894bd67a 100644 --- a/tests/schemas/state/scan_bad.out +++ b/tests/schemas/state/scan_bad.out @@ -1,2 +1,3 @@ -1 schema violations found - /discovery/families: object instance has properties which are not allowed by the schema: ["BACnet"] +While converting to json node: 1 schema violations found + 1 schema violations found + /discovery/families: object instance has properties which are not allowed by the schema: ["BACnet"] From a7c70e528397a90c6c31c2be19360ad9b570f6e0 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 22 Nov 2024 14:38:56 -0800 Subject: [PATCH 07/15] Linty fix --- .../java/com/google/daq/mqtt/validator/ReportingDevice.java | 3 +++ .../main/java/com/google/daq/mqtt/validator/Validator.java | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/ReportingDevice.java b/validator/src/main/java/com/google/daq/mqtt/validator/ReportingDevice.java index d35712326b..ba67641497 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/ReportingDevice.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/ReportingDevice.java @@ -349,6 +349,9 @@ public List getMessageEntries() { return messageEntries; } + /** + * Check for errors and throw a fit if necessary. + */ public void throwIfFailure() { if (!hasErrors()) { return; diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java b/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java index 1b79ffbbe2..345cd0357c 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java @@ -11,7 +11,6 @@ import static com.google.daq.mqtt.util.ConfigUtil.readExeConfig; import static com.google.daq.mqtt.util.PubSubClient.getFeedInfo; import static com.google.daq.mqtt.validator.ReportingDevice.typeFolderPairKey; -import static com.google.udmi.util.Common.DEVICE_ID_KEY; import static com.google.udmi.util.Common.ERROR_KEY; import static com.google.udmi.util.Common.EXCEPTION_KEY; import static com.google.udmi.util.Common.EXIT_CODE_ERROR; @@ -814,7 +813,8 @@ private boolean processExceptions(Map attributes, String deviceI */ public void validateDeviceMessage(ReportingDevice device, Map message, Map attributes) { - String schemaName = ofNullable(attributes.get(SCHEMA_NAME_KEY)).orElseGet(() -> messageSchema(attributes)); + String schemaName = ofNullable(attributes.get(SCHEMA_NAME_KEY)).orElseGet( + () -> messageSchema(attributes)); upgradeMessage(schemaName, message); // Assume the attributes know what they're doing when the schema name is provided explicitly. From 113ad9ddd2ebaa8296a1f92957face6611fe831e Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 22 Nov 2024 18:30:30 -0800 Subject: [PATCH 08/15] Remove unnecessary exception cause --- .../.idea/runConfigurations/Schema_Tester.xml | 11 +++++++++++ .../com/google/daq/mqtt/validator/Validator.java | 16 +++------------- 2 files changed, 14 insertions(+), 13 deletions(-) create mode 100644 validator/.idea/runConfigurations/Schema_Tester.xml diff --git a/validator/.idea/runConfigurations/Schema_Tester.xml b/validator/.idea/runConfigurations/Schema_Tester.xml new file mode 100644 index 0000000000..bfff9219ec --- /dev/null +++ b/validator/.idea/runConfigurations/Schema_Tester.xml @@ -0,0 +1,11 @@ + + + + \ No newline at end of file diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java b/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java index 345cd0357c..38cb623d45 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java @@ -43,7 +43,6 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonNode; -import com.github.fge.jsonschema.core.exceptions.ProcessingException; import com.github.fge.jsonschema.core.load.configuration.LoadingConfiguration; import com.github.fge.jsonschema.core.load.download.URIDownloader; import com.github.fge.jsonschema.core.report.LogLevel; @@ -696,12 +695,9 @@ private void validateMessage(Object msgObject, Map attributes) { } } - private void validateMessage(JsonSchema schema, Object message) { - try { - validateJsonNode(schema, OBJECT_MAPPER.valueToTree(message)); - } catch (Exception e) { - throw new RuntimeException("While converting to json node: " + e.getMessage(), e); - } + private void validateMessage(JsonSchema schema, Object message) throws Exception { + ProcessingReport report = schema.validate(OBJECT_MAPPER.valueToTree(message), true); + ifTrueThen(!report.isSuccess(), () -> ifNotNullThrow(fromProcessingReport(report))); } private Instant getInstant(Object msgObject, Map attributes) { @@ -1319,12 +1315,6 @@ private void upgradeMessage(String schemaName, Map message) { message.putAll(objectMap); } - private void validateJsonNode(JsonSchema schema, JsonNode jsonNode) throws ProcessingException { - // TODO: TAP combine this is validation routine used by sequencer - ProcessingReport report = schema.validate(jsonNode, true); - ifTrueThen(!report.isSuccess(), () -> ifNotNullThrow(fromProcessingReport(report))); - } - private File getFullPath(String prefix, File targetFile) { return prefix == null ? targetFile : new File(new File(prefix), targetFile.getPath()); } From 1c7ca96285c4ff2c8e2e071145ea279451caef97 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 22 Nov 2024 18:30:43 -0800 Subject: [PATCH 09/15] Revert shema test output changes --- .../schemas/commands_discovery/provision.out | 5 ++--- .../config/blobset_final_incomplete_url.out | 5 ++--- tests/schemas/config/delta_x1_gateway.out | 7 +++---- tests/schemas/config/delta_x1_target.out | 7 +++---- tests/schemas/config/empty.out | 5 ++--- tests/schemas/config/errors.out | 15 +++++++-------- tests/schemas/config/fcu.out | 7 +++---- tests/schemas/config/gateway.out | 5 ++--- tests/schemas/config/smartprimus.out | 7 +++---- .../configuration_endpoint/multiple.out | 5 ++--- tests/schemas/envelope/empty.out | 5 ++--- tests/schemas/envelope/errors1.out | 11 +++++------ tests/schemas/envelope/errors2.out | 7 +++---- tests/schemas/events_discovery/empty.out | 5 ++--- tests/schemas/events_discovery/errors.out | 13 ++++++------- tests/schemas/events_discovery/node.out | 5 ++--- tests/schemas/events_mapping/prediction.out | 5 ++--- tests/schemas/events_pointset/empty.out | 5 ++--- tests/schemas/events_pointset/errors.out | 19 +++++++++---------- tests/schemas/events_system/categories.out | 15 +++++++-------- tests/schemas/events_system/empty.out | 5 ++--- tests/schemas/events_system/errors.out | 11 +++++------ tests/schemas/metadata/bad.out | 7 +++---- tests/schemas/metadata/empty.out | 5 ++--- tests/schemas/metadata/errors.out | 17 ++++++++--------- tests/schemas/metadata/nosys.out | 5 ++--- tests/schemas/metadata/toomany.out | 7 +++---- tests/schemas/site_metadata/errors.out | 9 ++++----- tests/schemas/state/delta_x1_gateway.out | 11 +++++------ tests/schemas/state/delta_x1_target.out | 7 +++---- tests/schemas/state/empty.out | 5 ++--- tests/schemas/state/errors.out | 15 +++++++-------- tests/schemas/state/makemodel_error.out | 7 +++---- tests/schemas/state/scan_bad.out | 5 ++--- 34 files changed, 120 insertions(+), 154 deletions(-) diff --git a/tests/schemas/commands_discovery/provision.out b/tests/schemas/commands_discovery/provision.out index 19183398e3..822eaae055 100644 --- a/tests/schemas/commands_discovery/provision.out +++ b/tests/schemas/commands_discovery/provision.out @@ -1,3 +1,2 @@ -While converting to json node: 1 schema violations found - 1 schema violations found - object instance has properties which are not allowed by the schema: ["provision"] +1 schema violations found + object instance has properties which are not allowed by the schema: ["provision"] diff --git a/tests/schemas/config/blobset_final_incomplete_url.out b/tests/schemas/config/blobset_final_incomplete_url.out index 309b00389e..b97f30ec93 100644 --- a/tests/schemas/config/blobset_final_incomplete_url.out +++ b/tests/schemas/config/blobset_final_incomplete_url.out @@ -1,3 +1,2 @@ -While converting to json node: 1 schema violations found - 1 schema violations found - /blobset/blobs/_firmware_update: object has missing required properties (["generation","sha256"]) +1 schema violations found + /blobset/blobs/_firmware_update: object has missing required properties (["generation","sha256"]) diff --git a/tests/schemas/config/delta_x1_gateway.out b/tests/schemas/config/delta_x1_gateway.out index 39e4af0ebf..ac8fda8b39 100644 --- a/tests/schemas/config/delta_x1_gateway.out +++ b/tests/schemas/config/delta_x1_gateway.out @@ -1,4 +1,3 @@ -While converting to json node: 2 schema violations found - 2 schema violations found - /localnet: object instance has properties which are not allowed by the schema: ["subsystem"] - object has missing required properties (["version"]) +2 schema violations found + /localnet: object instance has properties which are not allowed by the schema: ["subsystem"] + object has missing required properties (["version"]) diff --git a/tests/schemas/config/delta_x1_target.out b/tests/schemas/config/delta_x1_target.out index 39e4af0ebf..ac8fda8b39 100644 --- a/tests/schemas/config/delta_x1_target.out +++ b/tests/schemas/config/delta_x1_target.out @@ -1,4 +1,3 @@ -While converting to json node: 2 schema violations found - 2 schema violations found - /localnet: object instance has properties which are not allowed by the schema: ["subsystem"] - object has missing required properties (["version"]) +2 schema violations found + /localnet: object instance has properties which are not allowed by the schema: ["subsystem"] + object has missing required properties (["version"]) diff --git a/tests/schemas/config/empty.out b/tests/schemas/config/empty.out index a43a45d0df..6b478b7302 100644 --- a/tests/schemas/config/empty.out +++ b/tests/schemas/config/empty.out @@ -1,3 +1,2 @@ -While converting to json node: 1 schema violations found - 1 schema violations found - object has missing required properties (["timestamp","version"]) +1 schema violations found + object has missing required properties (["timestamp","version"]) diff --git a/tests/schemas/config/errors.out b/tests/schemas/config/errors.out index 633b4bfd99..e2c83487a7 100644 --- a/tests/schemas/config/errors.out +++ b/tests/schemas/config/errors.out @@ -1,8 +1,7 @@ -While converting to json node: 6 schema violations found - 6 schema violations found - /pointset/points/return_air_temperature_sensor: object instance has properties which are not allowed by the schema: ["object_type"] - /pointset/sample_rate_sec: instance type (string) does not match any allowed primitive type (allowed: ["integer"]) - /pointset/state_etag: string "2a8b71dwqhdhdddddddddddddddddddddddddddddddddddddddddd8" is too long (length: 55, maximum allowed: 32) - /pointset/version: instance type (integer) does not match any allowed primitive type (allowed: ["string"]) - /pointset: object instance has properties which are not allowed by the schema: ["config_etag","id","properties"] - object instance has properties which are not allowed by the schema: ["points","properties","type","upgraded_from"] +6 schema violations found + /pointset/points/return_air_temperature_sensor: object instance has properties which are not allowed by the schema: ["object_type"] + /pointset/sample_rate_sec: instance type (string) does not match any allowed primitive type (allowed: ["integer"]) + /pointset/state_etag: string "2a8b71dwqhdhdddddddddddddddddddddddddddddddddddddddddd8" is too long (length: 55, maximum allowed: 32) + /pointset/version: instance type (integer) does not match any allowed primitive type (allowed: ["string"]) + /pointset: object instance has properties which are not allowed by the schema: ["config_etag","id","properties"] + object instance has properties which are not allowed by the schema: ["points","properties","type","upgraded_from"] diff --git a/tests/schemas/config/fcu.out b/tests/schemas/config/fcu.out index a314ba1ff2..cedf4f9585 100644 --- a/tests/schemas/config/fcu.out +++ b/tests/schemas/config/fcu.out @@ -1,4 +1,3 @@ -While converting to json node: 2 schema violations found - 2 schema violations found - /pointset/points/chilled_water_valve_percentage_command: object instance has properties which are not allowed by the schema: ["min_update_ms"] - /system: object instance has properties which are not allowed by the schema: ["max_update_ms"] +2 schema violations found + /pointset/points/chilled_water_valve_percentage_command: object instance has properties which are not allowed by the schema: ["min_update_ms"] + /system: object instance has properties which are not allowed by the schema: ["max_update_ms"] diff --git a/tests/schemas/config/gateway.out b/tests/schemas/config/gateway.out index e453808440..a66518e068 100644 --- a/tests/schemas/config/gateway.out +++ b/tests/schemas/config/gateway.out @@ -1,3 +1,2 @@ -While converting to json node: 1 schema violations found - 1 schema violations found - /gateway/proxy_ids/2: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "991" +1 schema violations found + /gateway/proxy_ids/2: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "991" diff --git a/tests/schemas/config/smartprimus.out b/tests/schemas/config/smartprimus.out index cbad7ad3b7..c06af5362a 100644 --- a/tests/schemas/config/smartprimus.out +++ b/tests/schemas/config/smartprimus.out @@ -1,4 +1,3 @@ -While converting to json node: 2 schema violations found - 2 schema violations found - /pointset/points/fan_run_enable: object instance has properties which are not allowed by the schema: ["fix_value"] - /pointset/points/fan_run_status: object instance has properties which are not allowed by the schema: ["fix_value"] +2 schema violations found + /pointset/points/fan_run_enable: object instance has properties which are not allowed by the schema: ["fix_value"] + /pointset/points/fan_run_status: object instance has properties which are not allowed by the schema: ["fix_value"] diff --git a/tests/schemas/configuration_endpoint/multiple.out b/tests/schemas/configuration_endpoint/multiple.out index 28d8793a11..7b0b39a451 100644 --- a/tests/schemas/configuration_endpoint/multiple.out +++ b/tests/schemas/configuration_endpoint/multiple.out @@ -1,3 +1,2 @@ -While converting to json node: 1 schema violations found - 1 schema violations found - /topic_prefix: ECMA 262 regex "^[-_/a-zA-Z0-9]+$" does not match input string "/devices/#" +1 schema violations found + /topic_prefix: ECMA 262 regex "^[-_/a-zA-Z0-9]+$" does not match input string "/devices/#" diff --git a/tests/schemas/envelope/empty.out b/tests/schemas/envelope/empty.out index 5e0a72685d..411a14b17c 100644 --- a/tests/schemas/envelope/empty.out +++ b/tests/schemas/envelope/empty.out @@ -1,3 +1,2 @@ -While converting to json node: 1 schema violations found - 1 schema violations found - object has missing required properties (["deviceRegistryId"]) +1 schema violations found + object has missing required properties (["deviceRegistryId"]) diff --git a/tests/schemas/envelope/errors1.out b/tests/schemas/envelope/errors1.out index 6d75a25093..e149c3adfd 100644 --- a/tests/schemas/envelope/errors1.out +++ b/tests/schemas/envelope/errors1.out @@ -1,6 +1,5 @@ -While converting to json node: 4 schema violations found - 4 schema violations found - /deviceId: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "fcu-1" - /deviceNumId: ECMA 262 regex "^[0-9]+$" does not match input string "921302198324X" - /deviceRegistryId: ECMA 262 regex "^[a-zA-Z][-a-zA-Z0-9._+~%]*[a-zA-Z0-9]$" does not match input string "test/registry" - /subType: instance value (5) not found in enum (possible values: ["invalid","reflect","events","errors","commands","config","state","query","reply","model"]) +4 schema violations found + /deviceId: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "fcu-1" + /deviceNumId: ECMA 262 regex "^[0-9]+$" does not match input string "921302198324X" + /deviceRegistryId: ECMA 262 regex "^[a-zA-Z][-a-zA-Z0-9._+~%]*[a-zA-Z0-9]$" does not match input string "test/registry" + /subType: instance value (5) not found in enum (possible values: ["invalid","reflect","events","errors","commands","config","state","query","reply","model"]) diff --git a/tests/schemas/envelope/errors2.out b/tests/schemas/envelope/errors2.out index 00375e8533..a903995aa1 100644 --- a/tests/schemas/envelope/errors2.out +++ b/tests/schemas/envelope/errors2.out @@ -1,4 +1,3 @@ -While converting to json node: 2 schema violations found - 2 schema violations found - /deviceId: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "FCUs_02_NW_12" - /deviceNumId: ECMA 262 regex "^[0-9]+$" does not match input string "-9213923812" +2 schema violations found + /deviceId: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "FCUs_02_NW_12" + /deviceNumId: ECMA 262 regex "^[0-9]+$" does not match input string "-9213923812" diff --git a/tests/schemas/events_discovery/empty.out b/tests/schemas/events_discovery/empty.out index 88fabcd688..17f84d9366 100644 --- a/tests/schemas/events_discovery/empty.out +++ b/tests/schemas/events_discovery/empty.out @@ -1,3 +1,2 @@ -While converting to json node: 1 schema violations found - 1 schema violations found - object has missing required properties (["scan_family","timestamp","version"]) +1 schema violations found + object has missing required properties (["scan_family","timestamp","version"]) diff --git a/tests/schemas/events_discovery/errors.out b/tests/schemas/events_discovery/errors.out index 4640defbd2..89e23f0747 100644 --- a/tests/schemas/events_discovery/errors.out +++ b/tests/schemas/events_discovery/errors.out @@ -1,7 +1,6 @@ -While converting to json node: 5 schema violations found - 5 schema violations found - /families/bacnet: object has missing required properties (["addr"]) - /families/bacnet: object instance has properties which are not allowed by the schema: ["id"] - /families/mac: object instance has properties which are not allowed by the schema: ["group"] - object has missing required properties (["scan_family"]) - object instance has properties which are not allowed by the schema: ["addr","id","points","uniqs"] +5 schema violations found + /families/bacnet: object has missing required properties (["addr"]) + /families/bacnet: object instance has properties which are not allowed by the schema: ["id"] + /families/mac: object instance has properties which are not allowed by the schema: ["group"] + object has missing required properties (["scan_family"]) + object instance has properties which are not allowed by the schema: ["addr","id","points","uniqs"] diff --git a/tests/schemas/events_discovery/node.out b/tests/schemas/events_discovery/node.out index 0d807b6d31..98fe9b373a 100644 --- a/tests/schemas/events_discovery/node.out +++ b/tests/schemas/events_discovery/node.out @@ -1,3 +1,2 @@ -While converting to json node: 1 schema violations found - 1 schema violations found - /system: object instance has properties which are not allowed by the schema: ["software"] +1 schema violations found + /system: object instance has properties which are not allowed by the schema: ["software"] diff --git a/tests/schemas/events_mapping/prediction.out b/tests/schemas/events_mapping/prediction.out index 3a7aee5005..11a2bfe8cf 100644 --- a/tests/schemas/events_mapping/prediction.out +++ b/tests/schemas/events_mapping/prediction.out @@ -1,3 +1,2 @@ -While converting to json node: 1 schema violations found - 1 schema violations found - object instance has properties which are not allowed by the schema: ["prediction"] +1 schema violations found + object instance has properties which are not allowed by the schema: ["prediction"] diff --git a/tests/schemas/events_pointset/empty.out b/tests/schemas/events_pointset/empty.out index 100298650d..bdb09a111e 100644 --- a/tests/schemas/events_pointset/empty.out +++ b/tests/schemas/events_pointset/empty.out @@ -1,3 +1,2 @@ -While converting to json node: 1 schema violations found - 1 schema violations found - object has missing required properties (["points","timestamp","version"]) +1 schema violations found + object has missing required properties (["points","timestamp","version"]) diff --git a/tests/schemas/events_pointset/errors.out b/tests/schemas/events_pointset/errors.out index b366f2ead1..1e6047f3d7 100644 --- a/tests/schemas/events_pointset/errors.out +++ b/tests/schemas/events_pointset/errors.out @@ -1,10 +1,9 @@ -While converting to json node: 8 schema violations found - 8 schema violations found - /points/guid: instance type (string) does not match any allowed primitive type (allowed: ["object"]) - /points/missing_present_value: object has missing required properties (["present_value"]) - /points/old_properties: object has missing required properties (["present_value"]) - /points/old_properties: object instance has properties which are not allowed by the schema: ["properties"] - /points/yoyo_motion_sensor: object has missing required properties (["present_value"]) - /points/yoyo_motion_sensor: object instance has properties which are not allowed by the schema: ["bad_property_name"] - /points: object instance has properties which are not allowed by the schema: ["analogValue_1","bad_____sensor","bad_entity_name_","comment$string"] - object instance has properties which are not allowed by the schema: ["comment$string","id","properties","state_etag"] +8 schema violations found + /points/guid: instance type (string) does not match any allowed primitive type (allowed: ["object"]) + /points/missing_present_value: object has missing required properties (["present_value"]) + /points/old_properties: object has missing required properties (["present_value"]) + /points/old_properties: object instance has properties which are not allowed by the schema: ["properties"] + /points/yoyo_motion_sensor: object has missing required properties (["present_value"]) + /points/yoyo_motion_sensor: object instance has properties which are not allowed by the schema: ["bad_property_name"] + /points: object instance has properties which are not allowed by the schema: ["analogValue_1","bad_____sensor","bad_entity_name_","comment$string"] + object instance has properties which are not allowed by the schema: ["comment$string","id","properties","state_etag"] diff --git a/tests/schemas/events_system/categories.out b/tests/schemas/events_system/categories.out index a9b587920f..182878a8e6 100644 --- a/tests/schemas/events_system/categories.out +++ b/tests/schemas/events_system/categories.out @@ -1,8 +1,7 @@ -While converting to json node: 6 schema violations found - 6 schema violations found - /logentries/3/category: instance failed to match exactly one schema (matched 0 out of 37) - /logentries/4/category: instance failed to match exactly one schema (matched 0 out of 37) - /logentries/5/category: instance failed to match exactly one schema (matched 0 out of 37) - /logentries/6/category: instance failed to match exactly one schema (matched 0 out of 37) - /logentries/7/category: instance failed to match exactly one schema (matched 0 out of 37) - /logentries/9/category: instance failed to match exactly one schema (matched 0 out of 37) +6 schema violations found + /logentries/3/category: instance failed to match exactly one schema (matched 0 out of 37) + /logentries/4/category: instance failed to match exactly one schema (matched 0 out of 37) + /logentries/5/category: instance failed to match exactly one schema (matched 0 out of 37) + /logentries/6/category: instance failed to match exactly one schema (matched 0 out of 37) + /logentries/7/category: instance failed to match exactly one schema (matched 0 out of 37) + /logentries/9/category: instance failed to match exactly one schema (matched 0 out of 37) diff --git a/tests/schemas/events_system/empty.out b/tests/schemas/events_system/empty.out index a43a45d0df..6b478b7302 100644 --- a/tests/schemas/events_system/empty.out +++ b/tests/schemas/events_system/empty.out @@ -1,3 +1,2 @@ -While converting to json node: 1 schema violations found - 1 schema violations found - object has missing required properties (["timestamp","version"]) +1 schema violations found + object has missing required properties (["timestamp","version"]) diff --git a/tests/schemas/events_system/errors.out b/tests/schemas/events_system/errors.out index 5f02a906bd..96ea55c516 100644 --- a/tests/schemas/events_system/errors.out +++ b/tests/schemas/events_system/errors.out @@ -1,6 +1,5 @@ -While converting to json node: 4 schema violations found - 4 schema violations found - /logentries/0/category: instance failed to match exactly one schema (matched 0 out of 37) - /logentries/0/level: numeric instance is lower than the required minimum (minimum: 100, found: 60) - /logentries/0: object has missing required properties (["message","timestamp"]) - /logentries/1: instance type (string) does not match any allowed primitive type (allowed: ["object"]) +4 schema violations found + /logentries/0/category: instance failed to match exactly one schema (matched 0 out of 37) + /logentries/0/level: numeric instance is lower than the required minimum (minimum: 100, found: 60) + /logentries/0: object has missing required properties (["message","timestamp"]) + /logentries/1: instance type (string) does not match any allowed primitive type (allowed: ["object"]) diff --git a/tests/schemas/metadata/bad.out b/tests/schemas/metadata/bad.out index 95d58b548b..71a1590d72 100644 --- a/tests/schemas/metadata/bad.out +++ b/tests/schemas/metadata/bad.out @@ -1,4 +1,3 @@ -While converting to json node: 2 schema violations found - 2 schema violations found - /gateway/proxy_ids/0: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "AHU-001" - /gateway/proxy_ids/1: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "A-1" +2 schema violations found + /gateway/proxy_ids/0: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "AHU-001" + /gateway/proxy_ids/1: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "A-1" diff --git a/tests/schemas/metadata/empty.out b/tests/schemas/metadata/empty.out index 17c7a41ff0..be18dff0c5 100644 --- a/tests/schemas/metadata/empty.out +++ b/tests/schemas/metadata/empty.out @@ -1,3 +1,2 @@ -While converting to json node: 1 schema violations found - 1 schema violations found - object has missing required properties (["system","timestamp","version"]) +1 schema violations found + object has missing required properties (["system","timestamp","version"]) diff --git a/tests/schemas/metadata/errors.out b/tests/schemas/metadata/errors.out index 533c7eef9c..5e04d07a5f 100644 --- a/tests/schemas/metadata/errors.out +++ b/tests/schemas/metadata/errors.out @@ -1,9 +1,8 @@ -While converting to json node: 7 schema violations found - 7 schema violations found - /pointset/points/return_air_temperature_sensor: object instance has properties which are not allowed by the schema: ["monkeys"] - /pointset: object instance has properties which are not allowed by the schema: ["rabbits"] - /system/location/site: ECMA 262 regex "^[A-Z]{2}-[A-Z]{3,4}-[A-Z0-9]{2,9}$" does not match input string "New Zealand" - /system/physical_tag/asset/name: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "AHU-A01_extension11-option" - /system/physical_tag/asset/site: ECMA 262 regex "^[A-Z]{2}-[A-Z]{3,4}-[A-Z0-9]{2,9}$" does not match input string "US-SFO-XYY_Noope!" - /system/physical_tag/asset: object has missing required properties (["guid"]) - /system: object instance has properties which are not allowed by the schema: ["guid"] +7 schema violations found + /pointset/points/return_air_temperature_sensor: object instance has properties which are not allowed by the schema: ["monkeys"] + /pointset: object instance has properties which are not allowed by the schema: ["rabbits"] + /system/location/site: ECMA 262 regex "^[A-Z]{2}-[A-Z]{3,4}-[A-Z0-9]{2,9}$" does not match input string "New Zealand" + /system/physical_tag/asset/name: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "AHU-A01_extension11-option" + /system/physical_tag/asset/site: ECMA 262 regex "^[A-Z]{2}-[A-Z]{3,4}-[A-Z0-9]{2,9}$" does not match input string "US-SFO-XYY_Noope!" + /system/physical_tag/asset: object has missing required properties (["guid"]) + /system: object instance has properties which are not allowed by the schema: ["guid"] diff --git a/tests/schemas/metadata/nosys.out b/tests/schemas/metadata/nosys.out index 0bbe4689b6..e7346293c0 100644 --- a/tests/schemas/metadata/nosys.out +++ b/tests/schemas/metadata/nosys.out @@ -1,3 +1,2 @@ -While converting to json node: 1 schema violations found - 1 schema violations found - object has missing required properties (["system"]) +1 schema violations found + object has missing required properties (["system"]) diff --git a/tests/schemas/metadata/toomany.out b/tests/schemas/metadata/toomany.out index b017e34774..ccd0449403 100644 --- a/tests/schemas/metadata/toomany.out +++ b/tests/schemas/metadata/toomany.out @@ -1,4 +1,3 @@ -While converting to json node: 2 schema violations found - 2 schema violations found - /pointset/points: object has too many properties (found 672 but schema requires at most 150) - /system/physical_tag/asset/name: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "UK-LON-S2_LTGW-3" +2 schema violations found + /pointset/points: object has too many properties (found 672 but schema requires at most 150) + /system/physical_tag/asset/name: ECMA 262 regex "^[A-Z]{2,6}-[1-9][0-9]*$" does not match input string "UK-LON-S2_LTGW-3" diff --git a/tests/schemas/site_metadata/errors.out b/tests/schemas/site_metadata/errors.out index 4548c7565a..f65310a0a8 100644 --- a/tests/schemas/site_metadata/errors.out +++ b/tests/schemas/site_metadata/errors.out @@ -1,5 +1,4 @@ -While converting to json node: 3 schema violations found - 3 schema violations found - /parameters/area/net_occupied_area/unit: instance failed to match exactly one schema (matched 0 out of 7) - /parameters/area: object instance has properties which are not allowed by the schema: ["extra"] - object has missing required properties (["timestamp"]) +3 schema violations found + /parameters/area/net_occupied_area/unit: instance failed to match exactly one schema (matched 0 out of 7) + /parameters/area: object instance has properties which are not allowed by the schema: ["extra"] + object has missing required properties (["timestamp"]) diff --git a/tests/schemas/state/delta_x1_gateway.out b/tests/schemas/state/delta_x1_gateway.out index f015b3eeca..3f6e25a6f4 100644 --- a/tests/schemas/state/delta_x1_gateway.out +++ b/tests/schemas/state/delta_x1_gateway.out @@ -1,6 +1,5 @@ -While converting to json node: 4 schema violations found - 4 schema violations found - /gateway: object instance has properties which are not allowed by the schema: ["error_ids"] - /system/hardware: object has missing required properties (["make","model"]) - /system/hardware: object instance has properties which are not allowed by the schema: ["cpu_usage","free_dynamic_memory","last_reset_timestamp","last_restart_reason","reset_count","revision","total_dynamic_memory"] - object instance has properties which are not allowed by the schema: ["last_config"] +4 schema violations found + /gateway: object instance has properties which are not allowed by the schema: ["error_ids"] + /system/hardware: object has missing required properties (["make","model"]) + /system/hardware: object instance has properties which are not allowed by the schema: ["cpu_usage","free_dynamic_memory","last_reset_timestamp","last_restart_reason","reset_count","revision","total_dynamic_memory"] + object instance has properties which are not allowed by the schema: ["last_config"] diff --git a/tests/schemas/state/delta_x1_target.out b/tests/schemas/state/delta_x1_target.out index d4aac02d41..859981bfa1 100644 --- a/tests/schemas/state/delta_x1_target.out +++ b/tests/schemas/state/delta_x1_target.out @@ -1,4 +1,3 @@ -While converting to json node: 2 schema violations found - 2 schema violations found - /system: object has missing required properties (["serial_no"]) - /system: object instance has properties which are not allowed by the schema: ["vendor_name"] +2 schema violations found + /system: object has missing required properties (["serial_no"]) + /system: object instance has properties which are not allowed by the schema: ["vendor_name"] diff --git a/tests/schemas/state/empty.out b/tests/schemas/state/empty.out index 17c7a41ff0..be18dff0c5 100644 --- a/tests/schemas/state/empty.out +++ b/tests/schemas/state/empty.out @@ -1,3 +1,2 @@ -While converting to json node: 1 schema violations found - 1 schema violations found - object has missing required properties (["system","timestamp","version"]) +1 schema violations found + object has missing required properties (["system","timestamp","version"]) diff --git a/tests/schemas/state/errors.out b/tests/schemas/state/errors.out index 47d4c6efc1..28692d9343 100644 --- a/tests/schemas/state/errors.out +++ b/tests/schemas/state/errors.out @@ -1,8 +1,7 @@ -While converting to json node: 6 schema violations found - 6 schema violations found - /pointset/points/return_air_temperature_sensor/status: instance type (string) does not match any allowed primitive type (allowed: ["object"]) - /pointset/points/return_air_temperature_sensor: object instance has properties which are not allowed by the schema: ["cov_increment","deadband","high_limit","instance_number","low_limit","object_type","rapt","resolution"] - /system/status: instance type (string) does not match any allowed primitive type (allowed: ["object"]) - /system: object has missing required properties (["hardware","last_config","operation","serial_no","software"]) - /system: object instance has properties which are not allowed by the schema: ["device_id","device_status","fling","object_name","system_status"] - object instance has properties which are not allowed by the schema: ["id","status"] +6 schema violations found + /pointset/points/return_air_temperature_sensor/status: instance type (string) does not match any allowed primitive type (allowed: ["object"]) + /pointset/points/return_air_temperature_sensor: object instance has properties which are not allowed by the schema: ["cov_increment","deadband","high_limit","instance_number","low_limit","object_type","rapt","resolution"] + /system/status: instance type (string) does not match any allowed primitive type (allowed: ["object"]) + /system: object has missing required properties (["hardware","last_config","operation","serial_no","software"]) + /system: object instance has properties which are not allowed by the schema: ["device_id","device_status","fling","object_name","system_status"] + object instance has properties which are not allowed by the schema: ["id","status"] diff --git a/tests/schemas/state/makemodel_error.out b/tests/schemas/state/makemodel_error.out index 995c903a60..779dc6ded7 100644 --- a/tests/schemas/state/makemodel_error.out +++ b/tests/schemas/state/makemodel_error.out @@ -1,4 +1,3 @@ -While converting to json node: 2 schema violations found - 2 schema violations found - /system: object has missing required properties (["hardware","software"]) - /system: object instance has properties which are not allowed by the schema: ["firmware","make_model"] +2 schema violations found + /system: object has missing required properties (["hardware","software"]) + /system: object instance has properties which are not allowed by the schema: ["firmware","make_model"] diff --git a/tests/schemas/state/scan_bad.out b/tests/schemas/state/scan_bad.out index 93894bd67a..4e3842bea6 100644 --- a/tests/schemas/state/scan_bad.out +++ b/tests/schemas/state/scan_bad.out @@ -1,3 +1,2 @@ -While converting to json node: 1 schema violations found - 1 schema violations found - /discovery/families: object instance has properties which are not allowed by the schema: ["BACnet"] +1 schema violations found + /discovery/families: object instance has properties which are not allowed by the schema: ["BACnet"] From 73be824b49b652bc1e591d0558a055f4cae1f747 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 22 Nov 2024 18:34:26 -0800 Subject: [PATCH 10/15] Cleanup unnecessary import --- .../src/main/java/com/google/daq/mqtt/validator/Validator.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java b/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java index 38cb623d45..0bd335f7ae 100644 --- a/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java +++ b/validator/src/main/java/com/google/daq/mqtt/validator/Validator.java @@ -103,7 +103,6 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicReference; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.regex.Pattern; @@ -1242,7 +1241,6 @@ private void validateFile( final File targetOut = getOutputPath(prefix, targetFile.replace(".json", ".out")); File outputFile = getOutputPath(prefix, targetFile); File inputFile = new File(targetFile); - AtomicReference exceptionOut = new AtomicReference<>(); try (OutputStream outputStream = Files.newOutputStream(outputFile.toPath())) { copyFileHeader(inputFile, outputStream); Map message = JsonUtil.loadMap(inputFile); From f48f854edaa6fadd91cf1025265be816631f90e0 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 22 Nov 2024 18:44:16 -0800 Subject: [PATCH 11/15] Clean up expected out --- .../devices/AHU-22/events_pointset.out | 8 ++-- .../devices/SNS-4/events_pointset.out | 6 +-- .../expected/devices/SNS-4/events_system.out | 8 ++-- .../simple/expected/validation_report.json | 46 +++++++++++-------- .../upgrade/expected/devices/AHU-1/state.out | 6 +-- .../expected/devices/AHU-1/state_system.out | 8 ++-- .../upgrade/expected/devices/AHU-22/state.out | 6 +-- .../upgrade/expected/devices/NON-1/state.out | 8 ++-- .../upgrade/expected/validation_report.json | 8 ++-- 9 files changed, 57 insertions(+), 47 deletions(-) diff --git a/tests/traces/simple/expected/devices/AHU-22/events_pointset.out b/tests/traces/simple/expected/devices/AHU-22/events_pointset.out index 88f68e21a2..1806aafde7 100644 --- a/tests/traces/simple/expected/devices/AHU-22/events_pointset.out +++ b/tests/traces/simple/expected/devices/AHU-22/events_pointset.out @@ -4,8 +4,8 @@ "sub_folder" : "pointset", "sub_type" : "events", "status" : { - "message" : "While converting to json node: 2 schema violations found", - "detail" : "events_pointset: While converting to json node: 2 schema violations found @Validator.validateMessage(REDACTED); 2 schema violations found; object instance has properties which are not allowed by the schema: [\"yesvalue\"]; object has missing required properties ([\"version\"])", + "message" : "2 schema violations found", + "detail" : "events_pointset: 2 schema violations found; object instance has properties which are not allowed by the schema: [\"yesvalue\"]; object has missing required properties ([\"version\"])", "category" : "validation.device.schema", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 @@ -15,8 +15,8 @@ "extra" : [ ] }, "errors" : [ { - "message" : "While converting to json node: 2 schema violations found", - "detail" : "events_pointset: While converting to json node: 2 schema violations found @Validator.validateMessage(REDACTED); 2 schema violations found; object instance has properties which are not allowed by the schema: [\"yesvalue\"]; object has missing required properties ([\"version\"])", + "message" : "2 schema violations found", + "detail" : "events_pointset: 2 schema violations found; object instance has properties which are not allowed by the schema: [\"yesvalue\"]; object has missing required properties ([\"version\"])", "category" : "validation.device.schema", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 diff --git a/tests/traces/simple/expected/devices/SNS-4/events_pointset.out b/tests/traces/simple/expected/devices/SNS-4/events_pointset.out index ae6aa7735e..bc6ade3ecc 100644 --- a/tests/traces/simple/expected/devices/SNS-4/events_pointset.out +++ b/tests/traces/simple/expected/devices/SNS-4/events_pointset.out @@ -5,7 +5,7 @@ "sub_type" : "events", "status" : { "message" : "Multiple validation errors", - "detail" : "While converting to json node: 1 schema violations found; Device has extra points: rocket_count, triangulating_axis_y", + "detail" : "1 schema violations found; Device has extra points: rocket_count, triangulating_axis_y", "category" : "validation.device.multiple", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 @@ -15,8 +15,8 @@ "extra" : [ "rocket_count", "triangulating_axis_y" ] }, "errors" : [ { - "message" : "While converting to json node: 1 schema violations found", - "detail" : "events_pointset: While converting to json node: 1 schema violations found @Validator.validateMessage(REDACTED); 1 schema violations found; object instance has properties which are not allowed by the schema: [\"monkey\"]", + "message" : "1 schema violations found", + "detail" : "events_pointset: 1 schema violations found; object instance has properties which are not allowed by the schema: [\"monkey\"]", "category" : "validation.device.schema", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 diff --git a/tests/traces/simple/expected/devices/SNS-4/events_system.out b/tests/traces/simple/expected/devices/SNS-4/events_system.out index 6c5c8c1f7f..b007b15d45 100644 --- a/tests/traces/simple/expected/devices/SNS-4/events_system.out +++ b/tests/traces/simple/expected/devices/SNS-4/events_system.out @@ -4,15 +4,15 @@ "sub_folder" : "system", "sub_type" : "events", "status" : { - "message" : "While converting to json node: 1 schema violations found", - "detail" : "events_system: While converting to json node: 1 schema violations found @Validator.validateMessage(REDACTED); 1 schema violations found; /logentries/0/category: instance entry category not recognized", + "message" : "1 schema violations found", + "detail" : "events_system: 1 schema violations found; /logentries/0/category: instance entry category not recognized", "category" : "validation.device.schema", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 }, "errors" : [ { - "message" : "While converting to json node: 1 schema violations found", - "detail" : "events_system: While converting to json node: 1 schema violations found @Validator.validateMessage(REDACTED); 1 schema violations found; /logentries/0/category: instance entry category not recognized", + "message" : "1 schema violations found", + "detail" : "events_system: 1 schema violations found; /logentries/0/category: instance entry category not recognized", "category" : "validation.device.schema", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 diff --git a/tests/traces/simple/expected/validation_report.json b/tests/traces/simple/expected/validation_report.json index 73ab4b9b83..7c4656ff83 100644 --- a/tests/traces/simple/expected/validation_report.json +++ b/tests/traces/simple/expected/validation_report.json @@ -7,47 +7,57 @@ REDACTED, "start_time" : "1999-10-20T01:02:03Z", "summary" : { - "correct_devices" : [ "AHU-1" ], - "extra_devices" : [ ], - "missing_devices" : [ ], - "error_devices" : [ "AHU-22", "GAT-123", "SNS-4" ] + "correct_devices" : [ ], + "extra_devices" : [ "NON-1", "NON-2" ], + "missing_devices" : [ "GAT-123" ], + "error_devices" : [ "AHU-1", "AHU-22", "SNS-4" ] }, "devices" : { "AHU-1" : { "last_seen" : "1999-10-20T01:02:03Z", "status" : { - "message" : "Successful validation", - "category" : "validation.device.receive", + "message" : "Multiple validation errors", + "detail" : "1 schema violations found; missing pointset subblock; 1 schema violations found", + "category" : "validation.device.multiple", "timestamp" : "1999-10-20T01:02:03Z", - "level" : 200 + "level" : 500 } }, "AHU-22" : { "last_seen" : "1999-10-20T01:02:03Z", "status" : { - "message" : "While converting to json node: 2 schema violations found", - "detail" : "events_pointset: While converting to json node: 2 schema violations found @Validator.validateMessage(REDACTED); 2 schema violations found; object instance has properties which are not allowed by the schema: [\"yesvalue\"]; object has missing required properties ([\"version\"])", - "category" : "validation.device.schema", + "message" : "Multiple validation errors", + "detail" : "1 schema violations found; missing pointset subblock", + "category" : "validation.device.multiple", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 } }, - "GAT-123" : { + "NON-1" : { "last_seen" : "1999-10-20T01:02:03Z", "status" : { - "message" : "missing pointset subblock", - "detail" : "state_update: missing pointset subblock", - "category" : "validation.device.schema", + "message" : "1 schema violations found", + "detail" : "state_update: 1 schema violations found; /system: object has missing required properties ([\"serial_no\"])", + "category" : "validation.device.extra", "timestamp" : "1999-10-20T01:02:03Z", - "level" : 500 + "level" : 400 + } + }, + "NON-2" : { + "last_seen" : "1999-10-20T01:02:03Z", + "status" : { + "message" : "Successful validation", + "category" : "validation.device.extra", + "timestamp" : "1999-10-20T01:02:03Z", + "level" : 400 } }, "SNS-4" : { "last_seen" : "1999-10-20T01:02:03Z", "status" : { - "message" : "Multiple validation errors", - "detail" : "While converting to json node: 1 schema violations found; Device has extra points: rocket_count, triangulating_axis_y; Unexpected character ('{' (code 123)): was expecting double-quote to start field name\n at [Source: (File), line: 1, column: 3]; While converting to json node: 1 schema violations found", - "category" : "validation.device.multiple", + "message" : "missing pointset subblock", + "detail" : "state_update: missing pointset subblock", + "category" : "validation.device.schema", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 } diff --git a/tests/traces/upgrade/expected/devices/AHU-1/state.out b/tests/traces/upgrade/expected/devices/AHU-1/state.out index 1bd549ce5d..82ae93dc82 100644 --- a/tests/traces/upgrade/expected/devices/AHU-1/state.out +++ b/tests/traces/upgrade/expected/devices/AHU-1/state.out @@ -5,14 +5,14 @@ "sub_type" : "state", "status" : { "message" : "Multiple validation errors", - "detail" : "While converting to json node: 1 schema violations found; missing pointset subblock", + "detail" : "1 schema violations found; missing pointset subblock", "category" : "validation.device.multiple", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 }, "errors" : [ { - "message" : "While converting to json node: 1 schema violations found", - "detail" : "state_update: While converting to json node: 1 schema violations found @Validator.validateMessage(REDACTED); 1 schema violations found; /system: object has missing required properties ([\"serial_no\"])", + "message" : "1 schema violations found", + "detail" : "state_update: 1 schema violations found; /system: object has missing required properties ([\"serial_no\"])", "category" : "validation.device.schema", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 diff --git a/tests/traces/upgrade/expected/devices/AHU-1/state_system.out b/tests/traces/upgrade/expected/devices/AHU-1/state_system.out index 1ad02b544f..4a74512835 100644 --- a/tests/traces/upgrade/expected/devices/AHU-1/state_system.out +++ b/tests/traces/upgrade/expected/devices/AHU-1/state_system.out @@ -4,15 +4,15 @@ "sub_folder" : "system", "sub_type" : "state", "status" : { - "message" : "While converting to json node: 1 schema violations found", - "detail" : "state_system: While converting to json node: 1 schema violations found @Validator.validateMessage(REDACTED); 1 schema violations found; object has missing required properties ([\"serial_no\"])", + "message" : "1 schema violations found", + "detail" : "state_system: 1 schema violations found; object has missing required properties ([\"serial_no\"])", "category" : "validation.device.schema", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 }, "errors" : [ { - "message" : "While converting to json node: 1 schema violations found", - "detail" : "state_system: While converting to json node: 1 schema violations found @Validator.validateMessage(REDACTED); 1 schema violations found; object has missing required properties ([\"serial_no\"])", + "message" : "1 schema violations found", + "detail" : "state_system: 1 schema violations found; object has missing required properties ([\"serial_no\"])", "category" : "validation.device.schema", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 diff --git a/tests/traces/upgrade/expected/devices/AHU-22/state.out b/tests/traces/upgrade/expected/devices/AHU-22/state.out index 1bd549ce5d..82ae93dc82 100644 --- a/tests/traces/upgrade/expected/devices/AHU-22/state.out +++ b/tests/traces/upgrade/expected/devices/AHU-22/state.out @@ -5,14 +5,14 @@ "sub_type" : "state", "status" : { "message" : "Multiple validation errors", - "detail" : "While converting to json node: 1 schema violations found; missing pointset subblock", + "detail" : "1 schema violations found; missing pointset subblock", "category" : "validation.device.multiple", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 }, "errors" : [ { - "message" : "While converting to json node: 1 schema violations found", - "detail" : "state_update: While converting to json node: 1 schema violations found @Validator.validateMessage(REDACTED); 1 schema violations found; /system: object has missing required properties ([\"serial_no\"])", + "message" : "1 schema violations found", + "detail" : "state_update: 1 schema violations found; /system: object has missing required properties ([\"serial_no\"])", "category" : "validation.device.schema", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 diff --git a/tests/traces/upgrade/expected/devices/NON-1/state.out b/tests/traces/upgrade/expected/devices/NON-1/state.out index caa8884df0..4c65baed52 100644 --- a/tests/traces/upgrade/expected/devices/NON-1/state.out +++ b/tests/traces/upgrade/expected/devices/NON-1/state.out @@ -4,15 +4,15 @@ "sub_folder" : "update", "sub_type" : "state", "status" : { - "message" : "While converting to json node: 1 schema violations found", - "detail" : "state_update: While converting to json node: 1 schema violations found @Validator.validateMessage(REDACTED); 1 schema violations found; /system: object has missing required properties ([\"serial_no\"])", + "message" : "1 schema violations found", + "detail" : "state_update: 1 schema violations found; /system: object has missing required properties ([\"serial_no\"])", "category" : "validation.device.schema", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 }, "errors" : [ { - "message" : "While converting to json node: 1 schema violations found", - "detail" : "state_update: While converting to json node: 1 schema violations found @Validator.validateMessage(REDACTED); 1 schema violations found; /system: object has missing required properties ([\"serial_no\"])", + "message" : "1 schema violations found", + "detail" : "state_update: 1 schema violations found; /system: object has missing required properties ([\"serial_no\"])", "category" : "validation.device.schema", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 diff --git a/tests/traces/upgrade/expected/validation_report.json b/tests/traces/upgrade/expected/validation_report.json index c6905a1986..7c4656ff83 100644 --- a/tests/traces/upgrade/expected/validation_report.json +++ b/tests/traces/upgrade/expected/validation_report.json @@ -17,7 +17,7 @@ "last_seen" : "1999-10-20T01:02:03Z", "status" : { "message" : "Multiple validation errors", - "detail" : "While converting to json node: 1 schema violations found; missing pointset subblock; While converting to json node: 1 schema violations found", + "detail" : "1 schema violations found; missing pointset subblock; 1 schema violations found", "category" : "validation.device.multiple", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 @@ -27,7 +27,7 @@ "last_seen" : "1999-10-20T01:02:03Z", "status" : { "message" : "Multiple validation errors", - "detail" : "While converting to json node: 1 schema violations found; missing pointset subblock", + "detail" : "1 schema violations found; missing pointset subblock", "category" : "validation.device.multiple", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 @@ -36,8 +36,8 @@ "NON-1" : { "last_seen" : "1999-10-20T01:02:03Z", "status" : { - "message" : "While converting to json node: 1 schema violations found", - "detail" : "state_update: While converting to json node: 1 schema violations found @Validator.validateMessage(REDACTED); 1 schema violations found; /system: object has missing required properties ([\"serial_no\"])", + "message" : "1 schema violations found", + "detail" : "state_update: 1 schema violations found; /system: object has missing required properties ([\"serial_no\"])", "category" : "validation.device.extra", "timestamp" : "1999-10-20T01:02:03Z", "level" : 400 From d7272f0dc21900d83590193db3545994ad76a0c1 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 22 Nov 2024 18:44:57 -0800 Subject: [PATCH 12/15] Upgrade spelling timeout --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 1c90c7f4d1..e4f1844aa1 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -57,7 +57,7 @@ jobs: spelling: name: Docs Spelling Checks runs-on: ubuntu-latest - timeout-minutes: 1 + timeout-minutes: 2 steps: - uses: actions/checkout@v4 - name: Check Spelling From 07ac23a17f1f967d7f2de21f913d359db8723f00 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 22 Nov 2024 22:29:26 -0800 Subject: [PATCH 13/15] Adding test trace simple --- .../.idea/runConfigurations/Test_Trace_Simple.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 validator/.idea/runConfigurations/Test_Trace_Simple.xml diff --git a/validator/.idea/runConfigurations/Test_Trace_Simple.xml b/validator/.idea/runConfigurations/Test_Trace_Simple.xml new file mode 100644 index 0000000000..fc7dadc5dc --- /dev/null +++ b/validator/.idea/runConfigurations/Test_Trace_Simple.xml @@ -0,0 +1,11 @@ + + + + \ No newline at end of file From 8082b84ca05a04fbc21236ded400cfb4c6bd3a0c Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 22 Nov 2024 22:36:33 -0800 Subject: [PATCH 14/15] Cleanup expected out --- .../simple/expected/validation_report.json | 46 ++++++++----------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/tests/traces/simple/expected/validation_report.json b/tests/traces/simple/expected/validation_report.json index 7c4656ff83..dfa095c54e 100644 --- a/tests/traces/simple/expected/validation_report.json +++ b/tests/traces/simple/expected/validation_report.json @@ -7,57 +7,47 @@ REDACTED, "start_time" : "1999-10-20T01:02:03Z", "summary" : { - "correct_devices" : [ ], - "extra_devices" : [ "NON-1", "NON-2" ], - "missing_devices" : [ "GAT-123" ], - "error_devices" : [ "AHU-1", "AHU-22", "SNS-4" ] + "correct_devices" : [ "AHU-1" ], + "extra_devices" : [ ], + "missing_devices" : [ ], + "error_devices" : [ "AHU-22", "GAT-123", "SNS-4" ] }, "devices" : { "AHU-1" : { "last_seen" : "1999-10-20T01:02:03Z", "status" : { - "message" : "Multiple validation errors", - "detail" : "1 schema violations found; missing pointset subblock; 1 schema violations found", - "category" : "validation.device.multiple", + "message" : "Successful validation", + "category" : "validation.device.receive", "timestamp" : "1999-10-20T01:02:03Z", - "level" : 500 + "level" : 200 } }, "AHU-22" : { "last_seen" : "1999-10-20T01:02:03Z", "status" : { - "message" : "Multiple validation errors", - "detail" : "1 schema violations found; missing pointset subblock", - "category" : "validation.device.multiple", + "message" : "2 schema violations found", + "detail" : "events_pointset: 2 schema violations found; object instance has properties which are not allowed by the schema: [\"yesvalue\"]; object has missing required properties ([\"version\"])", + "category" : "validation.device.schema", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 } }, - "NON-1" : { - "last_seen" : "1999-10-20T01:02:03Z", - "status" : { - "message" : "1 schema violations found", - "detail" : "state_update: 1 schema violations found; /system: object has missing required properties ([\"serial_no\"])", - "category" : "validation.device.extra", - "timestamp" : "1999-10-20T01:02:03Z", - "level" : 400 - } - }, - "NON-2" : { + "GAT-123" : { "last_seen" : "1999-10-20T01:02:03Z", "status" : { - "message" : "Successful validation", - "category" : "validation.device.extra", + "message" : "missing pointset subblock", + "detail" : "state_update: missing pointset subblock", + "category" : "validation.device.schema", "timestamp" : "1999-10-20T01:02:03Z", - "level" : 400 + "level" : 500 } }, "SNS-4" : { "last_seen" : "1999-10-20T01:02:03Z", "status" : { - "message" : "missing pointset subblock", - "detail" : "state_update: missing pointset subblock", - "category" : "validation.device.schema", + "message" : "Multiple validation errors", + "detail" : "1 schema violations found; Device has extra points: rocket_count, triangulating_axis_y; Unexpected character ('{' (code 123)): was expecting double-quote to start field name\n at [Source: (File), line: 1, column: 3]; 1 schema violations found", + "category" : "validation.device.multiple", "timestamp" : "1999-10-20T01:02:03Z", "level" : 500 } From 998dd7cab95f6d23d02efbfc3a10df5b55974526 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Fri, 22 Nov 2024 22:53:46 -0800 Subject: [PATCH 15/15] Cleanup validator out --- etc/validator.out | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/etc/validator.out b/etc/validator.out index bc4884bd22..4d4320d94d 100644 --- a/etc/validator.out +++ b/etc/validator.out @@ -66,7 +66,7 @@ sites/udmi_site_model/out/devices/AHU-1/events_pointset.out "sub_type" : "events", "status" : { "message" : "Multiple validation errors", - "detail" : "Timestamp skew REDACTED_DURATION (REDACTED_TIMESTAMP to REDACTED_TIMESTAMP) exceeds REDACTED_DURATION threshold; While converting to json node: 1 schema violations found", + "detail" : "Timestamp skew REDACTED_DURATION (REDACTED_TIMESTAMP to REDACTED_TIMESTAMP) exceeds REDACTED_DURATION threshold; 1 schema violations found", "category" : "validation.device.multiple", "timestamp" : "REDACTED_TIMESTAMP", "level" : 500 @@ -82,8 +82,8 @@ sites/udmi_site_model/out/devices/AHU-1/events_pointset.out "timestamp" : "REDACTED_TIMESTAMP", "level" : 500 }, { - "message" : "While converting to json node: 1 schema violations found", - "detail" : "events_pointset: While converting to json node: 1 schema violations found REDACTED_ERROR; 1 schema violations found; object instance has properties which are not allowed by the schema: [\"extraField\"]", + "message" : "1 schema violations found", + "detail" : "events_pointset: 1 schema violations found; object instance has properties which are not allowed by the schema: [\"extraField\"]", "category" : "validation.device.schema", "timestamp" : "REDACTED_TIMESTAMP", "level" : 500 @@ -145,7 +145,7 @@ sites/udmi_site_model/out/devices/AHU-1/state.out "sub_type" : "state", "status" : { "message" : "Multiple validation errors", - "detail" : "Timestamp skew REDACTED_DURATION (REDACTED_TIMESTAMP to REDACTED_TIMESTAMP) exceeds REDACTED_DURATION threshold; While converting to json node: 1 schema violations found", + "detail" : "Timestamp skew REDACTED_DURATION (REDACTED_TIMESTAMP to REDACTED_TIMESTAMP) exceeds REDACTED_DURATION threshold; 1 schema violations found", "category" : "validation.device.multiple", "timestamp" : "REDACTED_TIMESTAMP", "level" : 500 @@ -157,8 +157,8 @@ sites/udmi_site_model/out/devices/AHU-1/state.out "timestamp" : "REDACTED_TIMESTAMP", "level" : 500 }, { - "message" : "While converting to json node: 1 schema violations found", - "detail" : "state_update: While converting to json node: 1 schema violations found REDACTED_ERROR; 1 schema violations found; /system: object instance has properties which are not allowed by the schema: [\"extraField\"]", + "message" : "1 schema violations found", + "detail" : "state_update: 1 schema violations found; /system: object instance has properties which are not allowed by the schema: [\"extraField\"]", "category" : "validation.device.schema", "timestamp" : "REDACTED_TIMESTAMP", "level" : 500 @@ -411,15 +411,15 @@ sites/udmi_site_model/out/devices/GAT-123/events_discovery.out "sub_folder" : "discovery", "sub_type" : "events", "status" : { - "message" : "While converting to json node: 1 schema violations found", - "detail" : "events_discovery: While converting to json node: 1 schema violations found REDACTED_ERROR; 1 schema violations found; object has missing required properties ([\"scan_family\"])", + "message" : "1 schema violations found", + "detail" : "events_discovery: 1 schema violations found; object has missing required properties ([\"scan_family\"])", "category" : "validation.device.schema", "timestamp" : "REDACTED_TIMESTAMP", "level" : 500 }, "errors" : [ { - "message" : "While converting to json node: 1 schema violations found", - "detail" : "events_discovery: While converting to json node: 1 schema violations found REDACTED_ERROR; 1 schema violations found; object has missing required properties ([\"scan_family\"])", + "message" : "1 schema violations found", + "detail" : "events_discovery: 1 schema violations found; object has missing required properties ([\"scan_family\"])", "category" : "validation.device.schema", "timestamp" : "REDACTED_TIMESTAMP", "level" : 500