diff --git a/dotnet/src/DTDLParser/generated/ContextCollection.g.cs b/dotnet/src/DTDLParser/generated/ContextCollection.g.cs index 9526877a..f7bd4524 100644 --- a/dotnet/src/DTDLParser/generated/ContextCollection.g.cs +++ b/dotnet/src/DTDLParser/generated/ContextCollection.g.cs @@ -96,14 +96,15 @@ private static ContextHistory GetAffiliate2ContextHistory() VersionedContext context2_0 = new VersionedContext("dtmi:dtdl:extension:mqtt;2", 2, 0, 0, null, mergeDefinitions: false); context2_0.AddTermDefinition("Cacheable", new Dtmi("dtmi:dtdl:extension:mqtt:v2:Cacheable"), isMergeableType: false); + context2_0.AddTermDefinition("cmdServiceGroupId", new Dtmi("dtmi:dtdl:extension:mqtt:v2:Mqtt:cmdServiceGroupId"), isMergeableType: false); context2_0.AddTermDefinition("commandTopic", new Dtmi("dtmi:dtdl:extension:mqtt:v2:Mqtt:commandTopic"), isMergeableType: false); context2_0.AddTermDefinition("Idempotent", new Dtmi("dtmi:dtdl:extension:mqtt:v2:Idempotent"), isMergeableType: false); context2_0.AddTermDefinition("index", new Dtmi("dtmi:dtdl:extension:mqtt:v2:Indexed:index"), isMergeableType: false); context2_0.AddTermDefinition("Indexed", new Dtmi("dtmi:dtdl:extension:mqtt:v2:Indexed"), isMergeableType: false); context2_0.AddTermDefinition("Mqtt", new Dtmi("dtmi:dtdl:extension:mqtt:v2:Mqtt"), isMergeableType: false); context2_0.AddTermDefinition("payloadFormat", new Dtmi("dtmi:dtdl:extension:mqtt:v2:Mqtt:payloadFormat"), isMergeableType: false); - context2_0.AddTermDefinition("serviceGroupId", new Dtmi("dtmi:dtdl:extension:mqtt:v2:Mqtt:serviceGroupId"), isMergeableType: false); context2_0.AddTermDefinition("telemetryTopic", new Dtmi("dtmi:dtdl:extension:mqtt:v2:Mqtt:telemetryTopic"), isMergeableType: false); + context2_0.AddTermDefinition("telemServiceGroupId", new Dtmi("dtmi:dtdl:extension:mqtt:v2:Mqtt:telemServiceGroupId"), isMergeableType: false); context2_0.AddTermDefinition("Transparent", new Dtmi("dtmi:dtdl:extension:mqtt:v2:Transparent"), isMergeableType: false); context2_0.AddTermDefinition("ttl", new Dtmi("dtmi:dtdl:extension:mqtt:v2:Cacheable:ttl"), isMergeableType: false); versionedContexts.Add(context2_0); diff --git a/dotnet/src/DTDLParser/generated/SupplementalTypeCollection.g.cs b/dotnet/src/DTDLParser/generated/SupplementalTypeCollection.g.cs index 0c0ba6b5..c579dc99 100644 --- a/dotnet/src/DTDLParser/generated/SupplementalTypeCollection.g.cs +++ b/dotnet/src/DTDLParser/generated/SupplementalTypeCollection.g.cs @@ -382,10 +382,11 @@ static SupplementalTypeCollection() indexedInfoCV2.AllowedCotypeVersions = new HashSet() { 3, 4 }; DTSupplementalTypeInfo mqttInfoCV2 = new DTSupplementalTypeInfo(DTExtensionKind.AdjunctType, dtdlExtensionMqttContextIdV2, mqttTypeIdCV2, isAbstract: false, isMergeable: false, adjunctTypeTypeIdEV4); + mqttInfoCV2.AddProperty("dtmi:dtdl:extension:mqtt:v2:Mqtt:cmdServiceGroupId", new Uri("http://www.w3.org/2001/XMLSchema#string"), 1, null, null, null, null, regex: new Regex(@"^[!$-*,-.0-z|~]+$"), hasUniqueValue: false, isPlural: false, isOptional: true, defaultLanguage: null, dtmiSeg: null, dictionaryKey: null, idRequired: false, typeRequired: true, childOf: null, instanceProperty: null, requiredValues: null, requiredValuesString: null, requiredLiteral: null); mqttInfoCV2.AddProperty("dtmi:dtdl:extension:mqtt:v2:Mqtt:commandTopic", new Uri("http://www.w3.org/2001/XMLSchema#string"), 1, null, null, null, null, regex: new Regex(@"^(?:(?:[!%-*,-.0-z|~][!$-*,-.0-z|~]*)|(?:{(?:[A-Za-z]+:)?[A-Za-z]+}))(?:\/(?:(?:[!$-*,-.0-z|~]+)|(?:{(?:[A-Za-z]+:)?[A-Za-z]+})))*$"), hasUniqueValue: false, isPlural: false, isOptional: true, defaultLanguage: null, dtmiSeg: null, dictionaryKey: null, idRequired: false, typeRequired: true, childOf: null, instanceProperty: null, requiredValues: null, requiredValuesString: null, requiredLiteral: null); mqttInfoCV2.AddProperty("dtmi:dtdl:extension:mqtt:v2:Mqtt:payloadFormat", new Uri("http://www.w3.org/2001/XMLSchema#string"), 1, 1, null, null, null, regex: null, hasUniqueValue: false, isPlural: false, isOptional: false, defaultLanguage: null, dtmiSeg: null, dictionaryKey: null, idRequired: false, typeRequired: true, childOf: null, instanceProperty: null, requiredValues: null, requiredValuesString: null, requiredLiteral: null); - mqttInfoCV2.AddProperty("dtmi:dtdl:extension:mqtt:v2:Mqtt:serviceGroupId", new Uri("http://www.w3.org/2001/XMLSchema#string"), 1, null, null, null, null, regex: new Regex(@"^[!$-*,-.0-z|~]+$"), hasUniqueValue: false, isPlural: false, isOptional: true, defaultLanguage: null, dtmiSeg: null, dictionaryKey: null, idRequired: false, typeRequired: true, childOf: null, instanceProperty: null, requiredValues: null, requiredValuesString: null, requiredLiteral: null); mqttInfoCV2.AddProperty("dtmi:dtdl:extension:mqtt:v2:Mqtt:telemetryTopic", new Uri("http://www.w3.org/2001/XMLSchema#string"), 1, null, null, null, null, regex: new Regex(@"^(?:(?:[!%-*,-.0-z|~][!$-*,-.0-z|~]*)|(?:{(?:[A-Za-z]+:)?[A-Za-z]+}))(?:\/(?:(?:[!$-*,-.0-z|~]+)|(?:{(?:[A-Za-z]+:)?[A-Za-z]+})))*$"), hasUniqueValue: false, isPlural: false, isOptional: true, defaultLanguage: null, dtmiSeg: null, dictionaryKey: null, idRequired: false, typeRequired: true, childOf: null, instanceProperty: null, requiredValues: null, requiredValuesString: null, requiredLiteral: null); + mqttInfoCV2.AddProperty("dtmi:dtdl:extension:mqtt:v2:Mqtt:telemServiceGroupId", new Uri("http://www.w3.org/2001/XMLSchema#string"), 1, null, null, null, null, regex: new Regex(@"^[!$-*,-.0-z|~]+$"), hasUniqueValue: false, isPlural: false, isOptional: true, defaultLanguage: null, dtmiSeg: null, dictionaryKey: null, idRequired: false, typeRequired: true, childOf: null, instanceProperty: null, requiredValues: null, requiredValuesString: null, requiredLiteral: null); mqttInfoCV2.AllowedCotypeKinds = new HashSet() { DTEntityKind.Interface }; mqttInfoCV2.AllowedCotypeVersions = new HashSet() { 3, 4 }; diff --git a/dotnet/tests/ParserUnitTest/generated/ParserUnitTest.g.cs b/dotnet/tests/ParserUnitTest/generated/ParserUnitTest.g.cs index 5f428a6a..5d9ab383 100644 --- a/dotnet/tests/ParserUnitTest/generated/ParserUnitTest.g.cs +++ b/dotnet/tests/ParserUnitTest/generated/ParserUnitTest.g.cs @@ -1035,25 +1035,28 @@ public void TestParser_H(string testName) [DataRow("InterfaceValuePropertyV2")] [DataRow("InterfaceValuePropertyV3")] [DataRow("InterfaceValuePropertyV4")] + [DataRow("InterfaceWithAdjunctTypeMqttEmptyCmdServiceGroupIdV4")] [DataRow("InterfaceWithAdjunctTypeMqttEmptyCommandTopicV3")] [DataRow("InterfaceWithAdjunctTypeMqttEmptyCommandTopicV4")] - [DataRow("InterfaceWithAdjunctTypeMqttEmptyServiceGroupIdV4")] [DataRow("InterfaceWithAdjunctTypeMqttEmptyTelemetryTopicV3")] [DataRow("InterfaceWithAdjunctTypeMqttEmptyTelemetryTopicV4")] + [DataRow("InterfaceWithAdjunctTypeMqttEmptyTelemServiceGroupIdV4")] + [DataRow("InterfaceWithAdjunctTypeMqttInvalidCmdServiceGroupIdV4")] [DataRow("InterfaceWithAdjunctTypeMqttInvalidCommandTopicV3")] [DataRow("InterfaceWithAdjunctTypeMqttInvalidCommandTopicV4")] - [DataRow("InterfaceWithAdjunctTypeMqttInvalidServiceGroupIdV4")] [DataRow("InterfaceWithAdjunctTypeMqttInvalidTelemetryTopicV3")] [DataRow("InterfaceWithAdjunctTypeMqttInvalidTelemetryTopicV4")] + [DataRow("InterfaceWithAdjunctTypeMqttInvalidTelemServiceGroupIdV4")] [DataRow("InterfaceWithAdjunctTypeMqttNumericPayloadFormatV3")] [DataRow("InterfaceWithAdjunctTypeMqttNumericPayloadFormatV4")] [DataRow("InterfaceWithAdjunctTypeMqttV3")] [DataRow("InterfaceWithAdjunctTypeMqttV4")] + [DataRow("InterfaceWithAdjunctTypeMqttWithCmdServiceGroupIdV4")] [DataRow("InterfaceWithAdjunctTypeMqttWithOnlyPayloadFormatV3")] [DataRow("InterfaceWithAdjunctTypeMqttWithOnlyPayloadFormatV4")] [DataRow("InterfaceWithAdjunctTypeMqttWithoutPayloadFormatV3")] [DataRow("InterfaceWithAdjunctTypeMqttWithoutPayloadFormatV4")] - [DataRow("InterfaceWithAdjunctTypeMqttWithServiceGroupIdV4")] + [DataRow("InterfaceWithAdjunctTypeMqttWithTelemServiceGroupIdV4")] [DataRow("InterfaceWithNameV2")] [DataRow("InterfaceWithNameV3")] [DataRow("InterfaceWithNameV4")] diff --git a/dtdl/dtdl_digest.json b/dtdl/dtdl_digest.json index 8f460f98..83cc3932 100644 --- a/dtdl/dtdl_digest.json +++ b/dtdl/dtdl_digest.json @@ -651,14 +651,15 @@ }, "dtmi:dtdl:extension:mqtt;2": { "Cacheable": "dtmi:dtdl:extension:mqtt:v2:Cacheable", + "cmdServiceGroupId": "dtmi:dtdl:extension:mqtt:v2:Mqtt:cmdServiceGroupId", "commandTopic": "dtmi:dtdl:extension:mqtt:v2:Mqtt:commandTopic", "Idempotent": "dtmi:dtdl:extension:mqtt:v2:Idempotent", "index": "dtmi:dtdl:extension:mqtt:v2:Indexed:index", "Indexed": "dtmi:dtdl:extension:mqtt:v2:Indexed", "Mqtt": "dtmi:dtdl:extension:mqtt:v2:Mqtt", "payloadFormat": "dtmi:dtdl:extension:mqtt:v2:Mqtt:payloadFormat", - "serviceGroupId": "dtmi:dtdl:extension:mqtt:v2:Mqtt:serviceGroupId", "telemetryTopic": "dtmi:dtdl:extension:mqtt:v2:Mqtt:telemetryTopic", + "telemServiceGroupId": "dtmi:dtdl:extension:mqtt:v2:Mqtt:telemServiceGroupId", "Transparent": "dtmi:dtdl:extension:mqtt:v2:Transparent", "ttl": "dtmi:dtdl:extension:mqtt:v2:Cacheable:ttl" }, @@ -35157,6 +35158,25 @@ "mergeable": false, "parent": "dtmi:dtdl:class:AdjunctType;4", "properties": { + "dtmi:dtdl:extension:mqtt:v2:Mqtt:cmdServiceGroupId": { + "deprecated": false, + "description": { + "en-us": "The service group ID for subscribing to Command topics when shared subscriptions are wanted." + }, + "idRequired": false, + "maxCount": 1, + "optional": true, + "pattern": "^[!$-*,-.0-z|~]+$", + "patternDesc": { + "en-us": "non-empty string of printable ASCII characters not including space, \", +, #, {, }, or /" + }, + "plural": false, + "propertyName": "cmdServiceGroupId", + "type": "http://www.w3.org/2001/XMLSchema#string", + "typeName": "string", + "typeRequired": true, + "uniqueValue": false + }, "dtmi:dtdl:extension:mqtt:v2:Mqtt:commandTopic": { "deprecated": false, "description": { @@ -35192,39 +35212,39 @@ "typeRequired": true, "uniqueValue": false }, - "dtmi:dtdl:extension:mqtt:v2:Mqtt:serviceGroupId": { + "dtmi:dtdl:extension:mqtt:v2:Mqtt:telemetryTopic": { "deprecated": false, "description": { - "en-us": "The service group ID for subscribing to Command topics when shared subscriptions are wanted." + "en-us": "MQTT topic pattern on which a Telemetry or a collection of Telemetries is published." }, "idRequired": false, "maxCount": 1, "optional": true, - "pattern": "^[!$-*,-.0-z|~]+$", + "pattern": "^(?:(?:[!%-*,-.0-z|~][!$-*,-.0-z|~]*)|(?:{(?:[A-Za-z]+:)?[A-Za-z]+}))(?:\\/(?:(?:[!$-*,-.0-z|~]+)|(?:{(?:[A-Za-z]+:)?[A-Za-z]+})))*$", "patternDesc": { - "en-us": "non-empty string of printable ASCII characters not including space, \", +, #, {, }, or /" + "en-us": "slash-separated sequence of character-restricted labels and/or brace-enclosed tokens" }, "plural": false, - "propertyName": "serviceGroupId", + "propertyName": "telemetryTopic", "type": "http://www.w3.org/2001/XMLSchema#string", "typeName": "string", "typeRequired": true, "uniqueValue": false }, - "dtmi:dtdl:extension:mqtt:v2:Mqtt:telemetryTopic": { + "dtmi:dtdl:extension:mqtt:v2:Mqtt:telemServiceGroupId": { "deprecated": false, "description": { - "en-us": "MQTT topic pattern on which a Telemetry or a collection of Telemetries is published." + "en-us": "The service group ID for subscribing to Telemetry topics when shared subscriptions are wanted." }, "idRequired": false, "maxCount": 1, "optional": true, - "pattern": "^(?:(?:[!%-*,-.0-z|~][!$-*,-.0-z|~]*)|(?:{(?:[A-Za-z]+:)?[A-Za-z]+}))(?:\\/(?:(?:[!$-*,-.0-z|~]+)|(?:{(?:[A-Za-z]+:)?[A-Za-z]+})))*$", + "pattern": "^[!$-*,-.0-z|~]+$", "patternDesc": { - "en-us": "slash-separated sequence of character-restricted labels and/or brace-enclosed tokens" + "en-us": "non-empty string of printable ASCII characters not including space, \", +, #, {, }, or /" }, "plural": false, - "propertyName": "telemetryTopic", + "propertyName": "telemServiceGroupId", "type": "http://www.w3.org/2001/XMLSchema#string", "typeName": "string", "typeRequired": true, diff --git a/test-cases/generated/InterfaceWithAdjunctTypeMqttEmptyServiceGroupIdV4.json b/test-cases/generated/InterfaceWithAdjunctTypeMqttEmptyCmdServiceGroupIdV4.json similarity index 92% rename from test-cases/generated/InterfaceWithAdjunctTypeMqttEmptyServiceGroupIdV4.json rename to test-cases/generated/InterfaceWithAdjunctTypeMqttEmptyCmdServiceGroupIdV4.json index 32ea81a7..59f6c5b9 100644 --- a/test-cases/generated/InterfaceWithAdjunctTypeMqttEmptyServiceGroupIdV4.json +++ b/test-cases/generated/InterfaceWithAdjunctTypeMqttEmptyCmdServiceGroupIdV4.json @@ -19,7 +19,7 @@ "payloadFormat": "Json/ecma/404", "telemetryTopic": "sample/{modelId}/{senderId}/telemetry", "commandTopic": "sample/{modelId}/command/{commandName}", - "serviceGroupId": "", + "cmdServiceGroupId": "", "contents": [ { "@type": "Telemetry", @@ -51,7 +51,7 @@ { "ValidationID": "dtmi:dtdl:parsingError:stringInvalid", "PrimaryID": "dtmi:jsonTest:TelemetryAndCommand;1", - "Property": "dtmi:dtdl:extension:mqtt:v2:Mqtt:serviceGroupId", + "Property": "dtmi:dtdl:extension:mqtt:v2:Mqtt:cmdServiceGroupId", "Value": "", "PrimaryIndex": 0, "PrimaryStart": 14 diff --git a/test-cases/generated/InterfaceWithAdjunctTypeMqttEmptyTelemServiceGroupIdV4.json b/test-cases/generated/InterfaceWithAdjunctTypeMqttEmptyTelemServiceGroupIdV4.json new file mode 100644 index 00000000..59b36435 --- /dev/null +++ b/test-cases/generated/InterfaceWithAdjunctTypeMqttEmptyTelemServiceGroupIdV4.json @@ -0,0 +1,61 @@ +{ + "requiredContexts": [ + "dtmi:dtdl:extension:mqtt;2" + ], + "valid": false, + "quirks": [], + "options": [], + "input": [ + { + "@context": [ + "dtmi:dtdl:context;4", + "dtmi:dtdl:extension:mqtt;2" + ], + "@id": "dtmi:jsonTest:TelemetryAndCommand;1", + "@type": [ + "Interface", + "Mqtt" + ], + "payloadFormat": "Json/ecma/404", + "telemetryTopic": "sample/{modelId}/{senderId}/telemetry", + "commandTopic": "sample/{modelId}/command/{commandName}", + "telemServiceGroupId": "", + "contents": [ + { + "@type": "Telemetry", + "name": "distance", + "schema": "double" + }, + { + "@type": "Telemetry", + "name": "color", + "schema": "string" + }, + { + "@type": "Command", + "name": "doit", + "request": { + "name": "poke", + "schema": "string" + }, + "response": { + "name": "peek", + "schema": "integer" + } + } + ] + } + ], + "expect": { + "parsingErrors": [ + { + "ValidationID": "dtmi:dtdl:parsingError:stringInvalid", + "PrimaryID": "dtmi:jsonTest:TelemetryAndCommand;1", + "Property": "dtmi:dtdl:extension:mqtt:v2:Mqtt:telemServiceGroupId", + "Value": "", + "PrimaryIndex": 0, + "PrimaryStart": 14 + } + ] + } +} diff --git a/test-cases/generated/InterfaceWithAdjunctTypeMqttInvalidServiceGroupIdV4.json b/test-cases/generated/InterfaceWithAdjunctTypeMqttInvalidCmdServiceGroupIdV4.json similarity index 91% rename from test-cases/generated/InterfaceWithAdjunctTypeMqttInvalidServiceGroupIdV4.json rename to test-cases/generated/InterfaceWithAdjunctTypeMqttInvalidCmdServiceGroupIdV4.json index c5a192e0..3afc68d4 100644 --- a/test-cases/generated/InterfaceWithAdjunctTypeMqttInvalidServiceGroupIdV4.json +++ b/test-cases/generated/InterfaceWithAdjunctTypeMqttInvalidCmdServiceGroupIdV4.json @@ -19,7 +19,7 @@ "payloadFormat": "Json/ecma/404", "telemetryTopic": "sample/{modelId}/{senderId}/telemetry", "commandTopic": "sample/{modelId}/command/{commandName}", - "serviceGroupId": "hello/there", + "cmdServiceGroupId": "hello/there", "contents": [ { "@type": "Telemetry", @@ -51,7 +51,7 @@ { "ValidationID": "dtmi:dtdl:parsingError:stringInvalid", "PrimaryID": "dtmi:jsonTest:TelemetryAndCommand;1", - "Property": "dtmi:dtdl:extension:mqtt:v2:Mqtt:serviceGroupId", + "Property": "dtmi:dtdl:extension:mqtt:v2:Mqtt:cmdServiceGroupId", "Value": "hello/there", "PrimaryIndex": 0, "PrimaryStart": 14 diff --git a/test-cases/generated/InterfaceWithAdjunctTypeMqttInvalidTelemServiceGroupIdV4.json b/test-cases/generated/InterfaceWithAdjunctTypeMqttInvalidTelemServiceGroupIdV4.json new file mode 100644 index 00000000..564a5b50 --- /dev/null +++ b/test-cases/generated/InterfaceWithAdjunctTypeMqttInvalidTelemServiceGroupIdV4.json @@ -0,0 +1,61 @@ +{ + "requiredContexts": [ + "dtmi:dtdl:extension:mqtt;2" + ], + "valid": false, + "quirks": [], + "options": [], + "input": [ + { + "@context": [ + "dtmi:dtdl:context;4", + "dtmi:dtdl:extension:mqtt;2" + ], + "@id": "dtmi:jsonTest:TelemetryAndCommand;1", + "@type": [ + "Interface", + "Mqtt" + ], + "payloadFormat": "Json/ecma/404", + "telemetryTopic": "sample/{modelId}/{senderId}/telemetry", + "commandTopic": "sample/{modelId}/command/{commandName}", + "telemServiceGroupId": "hello/there", + "contents": [ + { + "@type": "Telemetry", + "name": "distance", + "schema": "double" + }, + { + "@type": "Telemetry", + "name": "color", + "schema": "string" + }, + { + "@type": "Command", + "name": "doit", + "request": { + "name": "poke", + "schema": "string" + }, + "response": { + "name": "peek", + "schema": "integer" + } + } + ] + } + ], + "expect": { + "parsingErrors": [ + { + "ValidationID": "dtmi:dtdl:parsingError:stringInvalid", + "PrimaryID": "dtmi:jsonTest:TelemetryAndCommand;1", + "Property": "dtmi:dtdl:extension:mqtt:v2:Mqtt:telemServiceGroupId", + "Value": "hello/there", + "PrimaryIndex": 0, + "PrimaryStart": 14 + } + ] + } +} diff --git a/test-cases/generated/InterfaceWithAdjunctTypeMqttWithServiceGroupIdV4.json b/test-cases/generated/InterfaceWithAdjunctTypeMqttWithCmdServiceGroupIdV4.json similarity index 93% rename from test-cases/generated/InterfaceWithAdjunctTypeMqttWithServiceGroupIdV4.json rename to test-cases/generated/InterfaceWithAdjunctTypeMqttWithCmdServiceGroupIdV4.json index 1bfa149e..14513f2e 100644 --- a/test-cases/generated/InterfaceWithAdjunctTypeMqttWithServiceGroupIdV4.json +++ b/test-cases/generated/InterfaceWithAdjunctTypeMqttWithCmdServiceGroupIdV4.json @@ -19,7 +19,7 @@ "payloadFormat": "Json/ecma/404", "telemetryTopic": "sample/{modelId}/{senderId}/telemetry", "commandTopic": "sample/{modelId}/command/{commandName}", - "serviceGroupId": "hello", + "cmdServiceGroupId": "hello", "contents": [ { "@type": "Telemetry", @@ -58,7 +58,7 @@ "dtmi:dtdl:extension:mqtt:v2:Mqtt:payloadFormat": "Json/ecma/404", "dtmi:dtdl:extension:mqtt:v2:Mqtt:telemetryTopic": "sample/{modelId}/{senderId}/telemetry", "dtmi:dtdl:extension:mqtt:v2:Mqtt:commandTopic": "sample/{modelId}/command/{commandName}", - "dtmi:dtdl:extension:mqtt:v2:Mqtt:serviceGroupId": "hello" + "dtmi:dtdl:extension:mqtt:v2:Mqtt:cmdServiceGroupId": "hello" } } ] diff --git a/test-cases/generated/InterfaceWithAdjunctTypeMqttWithTelemServiceGroupIdV4.json b/test-cases/generated/InterfaceWithAdjunctTypeMqttWithTelemServiceGroupIdV4.json new file mode 100644 index 00000000..3c660440 --- /dev/null +++ b/test-cases/generated/InterfaceWithAdjunctTypeMqttWithTelemServiceGroupIdV4.json @@ -0,0 +1,66 @@ +{ + "requiredContexts": [ + "dtmi:dtdl:extension:mqtt;2" + ], + "valid": true, + "quirks": [], + "options": [], + "input": [ + { + "@context": [ + "dtmi:dtdl:context;4", + "dtmi:dtdl:extension:mqtt;2" + ], + "@id": "dtmi:jsonTest:TelemetryAndCommand;1", + "@type": [ + "Interface", + "Mqtt" + ], + "payloadFormat": "Json/ecma/404", + "telemetryTopic": "sample/{modelId}/{senderId}/telemetry", + "commandTopic": "sample/{modelId}/command/{commandName}", + "telemServiceGroupId": "hello", + "contents": [ + { + "@type": "Telemetry", + "name": "distance", + "schema": "double" + }, + { + "@type": "Telemetry", + "name": "color", + "schema": "string" + }, + { + "@type": "Command", + "name": "doit", + "request": { + "name": "poke", + "schema": "string" + }, + "response": { + "name": "peek", + "schema": "integer" + } + } + ] + } + ], + "expect": { + "elements": [ + { + "id": "dtmi:jsonTest:TelemetryAndCommand;1", + "type": "Interface", + "supplementalTypes": [ + "dtmi:dtdl:extension:mqtt:v2:Mqtt" + ], + "supplementalProperties": { + "dtmi:dtdl:extension:mqtt:v2:Mqtt:payloadFormat": "Json/ecma/404", + "dtmi:dtdl:extension:mqtt:v2:Mqtt:telemetryTopic": "sample/{modelId}/{senderId}/telemetry", + "dtmi:dtdl:extension:mqtt:v2:Mqtt:commandTopic": "sample/{modelId}/command/{commandName}", + "dtmi:dtdl:extension:mqtt:v2:Mqtt:telemServiceGroupId": "hello" + } + } + ] + } +}