diff --git a/wot-codegen/src/Azure.Iot.Operations.CodeGeneration/ThingValidator.cs b/wot-codegen/src/Azure.Iot.Operations.CodeGeneration/ThingValidator.cs index 8ca178312..e453f10ac 100644 --- a/wot-codegen/src/Azure.Iot.Operations.CodeGeneration/ThingValidator.cs +++ b/wot-codegen/src/Azure.Iot.Operations.CodeGeneration/ThingValidator.cs @@ -73,17 +73,27 @@ public bool TryValidateThing(IResolvingThing resolvingThing, HashSet? title) return true; } + private bool TryValidateOptional(ArrayTracker? opt, MapTracker? actions, MapTracker? properties, MapTracker? evts) + { + if (opt?.Elements == null) + { + return true; + } + + foreach (var optElt in opt.Elements) + { + if (string.IsNullOrWhiteSpace(optElt.Value.Value)) + { + errorReporter.ReportError(ErrorCondition.PropertyEmpty, $"Optional element has empty string value.", optElt.TokenIndex); + return false; + } + + string[] optParts = optElt.Value.Value.Split('/', StringSplitOptions.RemoveEmptyEntries); + + if (optParts.Length < 2) + { + errorReporter.ReportError(ErrorCondition.PropertyUnsupportedValue, $"Optional element value '{optElt.Value.Value}' must be a 2-level JSON Pointer, such as '/{TDThing.ActionsName}/Example'.", optElt.TokenIndex); + return false; + } + + switch (optParts[0]) + { + case TDThing.ActionsName: + if (actions?.Entries == null) + { + errorReporter.ReportError(ErrorCondition.ItemNotFound, $"Optional element has value '{optElt.Value.Value}', but no '{TDThing.ActionsName}' collection in Thing Model.", optElt.TokenIndex); + return false; + } + if (!actions.Entries!.ContainsKey(optParts[1])) + { + errorReporter.ReportError(ErrorCondition.ItemNotFound, $"Optional element has value '{optElt.Value.Value}', but no '{optParts[1]}' action in Thing Model.", optElt.TokenIndex, actions.TokenIndex); + return false; + } + break; + case TDThing.PropertiesName: + if (properties?.Entries == null) + { + errorReporter.ReportError(ErrorCondition.ItemNotFound, $"Optional element has value '{optElt.Value.Value}', but no '{TDThing.PropertiesName}' collection in Thing Model.", optElt.TokenIndex); + return false; + } + if (!properties.Entries!.ContainsKey(optParts[1])) + { + errorReporter.ReportError(ErrorCondition.ItemNotFound, $"Optional element has value '{optElt.Value.Value}', but no '{optParts[1]}' property in Thing Model.", optElt.TokenIndex, properties.TokenIndex); + return false; + } + break; + case TDThing.EventsName: + if (evts?.Entries == null) + { + errorReporter.ReportError(ErrorCondition.ItemNotFound, $"Optional element has value '{optElt.Value.Value}', but no '{TDThing.EventsName}' collection in Thing Model.", optElt.TokenIndex); + return false; + } + if (!evts.Entries!.ContainsKey(optParts[1])) + { + errorReporter.ReportError(ErrorCondition.ItemNotFound, $"Optional element has value '{optElt.Value.Value}', but no '{optParts[1]}' event in Thing Model.", optElt.TokenIndex, evts.TokenIndex); + return false; + } + break; + default: + errorReporter.ReportError(ErrorCondition.PropertyUnsupportedValue, $"Optional element value '{optElt.Value.Value}' must be a JSON Pointer whose first level is '{TDThing.ActionsName}', '{TDThing.PropertiesName}', or '{TDThing.EventsName}'.", optElt.TokenIndex); + return false; + } + } + + return true; + } + + private bool TryValidateAffordanceGroups(ArrayTracker? propertyGroups, ArrayTracker? eventGroups, ArrayTracker? actionGroups) + { + bool hasError = false; + Dictionary allTitles = new(); + + if (!TryValidateAffordanceGroupArray(propertyGroups, TDThing.PropertyGroupsName, allTitles)) + { + hasError = true; + } + + if (!TryValidateAffordanceGroupArray(eventGroups, TDThing.EventGroupsName, allTitles)) + { + hasError = true; + } + + if (!TryValidateAffordanceGroupArray(actionGroups, TDThing.ActionGroupsName, allTitles)) + { + hasError = true; + } + + return !hasError; + } + + private bool TryValidateAffordanceGroupArray(ArrayTracker? groups, string propertyName, Dictionary allTitles) + { + if (groups?.Elements == null) + { + return true; + } + + bool hasError = false; + Dictionary localTitles = new(); + + foreach (ValueTracker element in groups.Elements) + { + if (element.DeserializingFailed) + { + hasError = true; + continue; + } + + TDAffordanceGroup group = element.Value; + ValueTracker? title = group.Title; + + if (title == null) + { + errorReporter.ReportError(ErrorCondition.PropertyMissing, $"Thing Model '{propertyName}' array element is missing required '{TDAffordanceGroup.TitleName}' property.", element.TokenIndex); + hasError = true; + continue; + } + + if (title.DeserializingFailed) + { + hasError = true; + continue; + } + + string titleValue = title.Value.Value; + if (string.IsNullOrWhiteSpace(titleValue)) + { + errorReporter.ReportError(ErrorCondition.PropertyEmpty, $"Thing Model '{propertyName}' array element '{TDAffordanceGroup.TitleName}' property has empty value.", title.TokenIndex); + hasError = true; + continue; + } + + if (localTitles.TryGetValue(titleValue, out long priorTokenIndex)) + { + errorReporter.ReportError(ErrorCondition.Duplication, $"Thing Model '{propertyName}' array contains duplicate '{TDAffordanceGroup.TitleName}' value \"{titleValue}\".", priorTokenIndex, title.TokenIndex); + hasError = true; + continue; + } + + localTitles[titleValue] = title.TokenIndex; + + if (allTitles.TryGetValue(titleValue, out long crossTokenIndex)) + { + errorReporter.ReportError(ErrorCondition.Duplication, $"Thing Model affordance groups contain duplicate '{TDAffordanceGroup.TitleName}' value \"{titleValue}\" across '{TDThing.PropertyGroupsName}', '{TDThing.EventGroupsName}', and '{TDThing.ActionGroupsName}' arrays.", crossTokenIndex, title.TokenIndex); + hasError = true; + continue; + } + + allTitles[titleValue] = title.TokenIndex; + } + + return !hasError; + } + + private bool TryValidateMemberOfMatchesGroup(ValueTracker memberOf, ArrayTracker? groups, string elementKind, string groupsPropertyName) + { + string memberOfValue = memberOf.Value.Value; + + if (groups?.Elements != null) + { + foreach (ValueTracker element in groups.Elements) + { + if (element.DeserializingFailed) + { + continue; + } + + ValueTracker? title = element.Value.Title; + if (title != null && !title.DeserializingFailed && title.Value.Value == memberOfValue) + { + return true; + } + } + } + + errorReporter.ReportError(ErrorCondition.ItemNotFound, $"{elementKind} element '{TDCommon.MemberOfName}' property value \"{memberOfValue}\" does not match the '{TDAffordanceGroup.TitleName}' of any element in the Thing Model '{groupsPropertyName}' array.", memberOf.TokenIndex); + return false; + } + private bool TryValidateCompositeAndEvent(TDThing thing, bool dovContextPresent, bool platContextPresent, long contextTokenIndex) { ValueTracker? isComposite = thing.IsComposite; @@ -699,6 +891,30 @@ private bool TryValidateTypeRef(ValueTracker? typeRef, PrefixType return true; } + private bool TryValidatePropertyIri(ValueTracker? propertyIri, bool dovContextPresent, string elementDescription, long contextTokenIndex) + { + if (propertyIri == null) + { + return true; + } + + bool hasError = false; + + if (!dovContextPresent) + { + errorReporter.ReportError(ErrorCondition.PropertyInvalid, $"{elementDescription} '{TDCommon.PropertyIriName}' property requires the Digital Operations Vocabulary context (\"{TDValues.ContextPrefixDoVocab}\") in the '{TDThing.ContextName}' property.", propertyIri.TokenIndex, contextTokenIndex); + hasError = true; + } + + if (string.IsNullOrWhiteSpace(propertyIri.Value.Value)) + { + errorReporter.ReportError(ErrorCondition.PropertyEmpty, $"{elementDescription} '{TDCommon.PropertyIriName}' property has empty value.", propertyIri.TokenIndex); + hasError = true; + } + + return !hasError; + } + private bool TryValidateLinks(IResolvingThing resolvingThing, bool dovContextPresent, bool platContextPresent, long contextTokenIndex, bool validateReferences) { if (resolvingThing.ParsedThing.Thing.Links?.Elements == null) @@ -923,7 +1139,7 @@ private bool TryValidateSchemaDefinitions(MapTracker? schemaDefini return !hasError; } - private bool TryValidateActions(MapTracker? actions, MapTracker? schemaDefinitions, HashSet serializationFormats, bool dovContextPresent, bool protContextPresent, bool platContextPresent, long contextTokenIndex) + private bool TryValidateActions(MapTracker? actions, MapTracker? schemaDefinitions, ArrayTracker? actionGroups, HashSet serializationFormats, bool dovContextPresent, bool protContextPresent, bool platContextPresent, long contextTokenIndex) { if (actions?.Entries == null) { @@ -934,7 +1150,7 @@ private bool TryValidateActions(MapTracker? actions, MapTracker> action in actions.Entries) { - if (!TryValidateAction(action.Key, action.Value, schemaDefinitions, out ValueTracker? contentType, dovContextPresent, protContextPresent, platContextPresent, contextTokenIndex)) + if (!TryValidateAction(action.Key, action.Value, schemaDefinitions, actionGroups, out ValueTracker? contentType, dovContextPresent, protContextPresent, platContextPresent, contextTokenIndex)) { hasError = true; } @@ -947,7 +1163,7 @@ private bool TryValidateActions(MapTracker? actions, MapTracker action, MapTracker? schemaDefinitions, out ValueTracker? contentType, bool dovContextPresent, bool protContextPresent, bool platContextPresent, long contextTokenIndex) + private bool TryValidateAction(string name, ValueTracker action, MapTracker? schemaDefinitions, ArrayTracker? actionGroups, out ValueTracker? contentType, bool dovContextPresent, bool protContextPresent, bool platContextPresent, long contextTokenIndex) { if (!TryValidateForms(action.Value.Forms, FormsKind.Action, schemaDefinitions, out contentType, dovContextPresent, protContextPresent, contextTokenIndex)) { @@ -972,18 +1188,33 @@ private bool TryValidateAction(string name, ValueTracker action, MapTr if (action.Value.MemberOf != null) { + bool memberOfHasError = false; if (!TryValidateRequiredContext(action.Value.MemberOfPrefixType, dovContextPresent, false, platContextPresent, $"Action element '{TDAction.MemberOfName}' property", action.Value.MemberOf.TokenIndex, contextTokenIndex)) { - hasError = true; + memberOfHasError = true; } if (string.IsNullOrWhiteSpace(action.Value.MemberOf.Value.Value)) { errorReporter.ReportError(ErrorCondition.PropertyEmpty, $"Action element '{TDAction.MemberOfName}' property has empty value.", action.Value.MemberOf.TokenIndex); + memberOfHasError = true; + } + else if (!memberOfHasError && !TryValidateMemberOfMatchesGroup(action.Value.MemberOf, actionGroups, "Action", TDThing.ActionGroupsName)) + { + memberOfHasError = true; + } + + if (memberOfHasError) + { hasError = true; } } + if (!TryValidatePropertyIri(action.Value.PropertyIri, dovContextPresent, "Action element", contextTokenIndex)) + { + hasError = true; + } + if (action.Value.Input != null && !TryValidateActionDataSchema(action.Value.Input, TDAction.InputName, contentType, dovContextPresent, protContextPresent, platContextPresent, contextTokenIndex)) { hasError = true; @@ -1028,7 +1259,7 @@ private bool TryValidateActionDataSchema(ValueTracker dataSchema, string p return TryValidateDataSchema(dataSchema, null, dovContextPresent, protContextPresent, platContextPresent, contextTokenIndex, DataSchemaKind.Action, contentType); } - private bool TryValidateProperties(MapTracker? properties, MapTracker? schemaDefinitions, HashSet serializationFormats, bool dovContextPresent, bool protContextPresent, bool platContextPresent, bool qudtContextPresent, long contextTokenIndex) + private bool TryValidateProperties(MapTracker? properties, MapTracker? schemaDefinitions, ArrayTracker? propertyGroups, HashSet serializationFormats, bool dovContextPresent, bool protContextPresent, bool platContextPresent, bool qudtContextPresent, long contextTokenIndex) { if (properties?.Entries == null) { @@ -1039,7 +1270,7 @@ private bool TryValidateProperties(MapTracker? properties, MapTracke foreach (KeyValuePair> property in properties.Entries) { - if (!TryValidateProperty(property.Key, property.Value, properties, schemaDefinitions, out ValueTracker? contentType, dovContextPresent, protContextPresent, platContextPresent, qudtContextPresent, contextTokenIndex)) + if (!TryValidateProperty(property.Key, property.Value, properties, schemaDefinitions, propertyGroups, out ValueTracker? contentType, dovContextPresent, protContextPresent, platContextPresent, qudtContextPresent, contextTokenIndex)) { hasError = true; } @@ -1063,7 +1294,7 @@ private bool TryValidateProperties(MapTracker? properties, MapTracke return !hasError; } - private bool TryValidateProperty(string name, ValueTracker property, MapTracker properties, MapTracker? schemaDefinitions, out ValueTracker? contentType, bool dovContextPresent, bool protContextPresent, bool platContextPresent, bool qudtContextPresent, long contextTokenIndex) + private bool TryValidateProperty(string name, ValueTracker property, MapTracker properties, MapTracker? schemaDefinitions, ArrayTracker? propertyGroups, out ValueTracker? contentType, bool dovContextPresent, bool protContextPresent, bool platContextPresent, bool qudtContextPresent, long contextTokenIndex) { if (!TryValidatePropertyForms(name, property.Value.Forms, schemaDefinitions, property.Value.ReadOnly, out contentType, dovContextPresent, protContextPresent, contextTokenIndex)) { @@ -1154,7 +1385,36 @@ private bool TryValidateProperty(string name, ValueTracker property, } } - if (!TryValidateDataSchema(property, (propName) => propName == TDProperty.ReadOnlyName || propName == TDProperty.PlaceholderName || propName == TDProperty.FormsName || propName == TDProperty.ContainsName || propName == TDProperty.ContainsLegacyName || propName == TDProperty.ContainedInName || propName == TDProperty.ContainedInLegacyName || propName == TDProperty.NamespaceName || propName == TDDataSchema.NamespaceLegacyName || propName == TDProperty.WithUnitName || propName == TDProperty.WithUnitLegacyName || propName == TDProperty.HasQuantityKindName, dovContextPresent, protContextPresent, platContextPresent, contextTokenIndex, DataSchemaKind.Property, contentType)) + if (property.Value.MemberOf != null) + { + bool memberOfHasError = false; + if (!TryValidateRequiredContext(property.Value.MemberOfPrefixType, dovContextPresent, false, platContextPresent, $"Property element '{TDProperty.MemberOfName}' property", property.Value.MemberOf.TokenIndex, contextTokenIndex)) + { + memberOfHasError = true; + } + + if (string.IsNullOrWhiteSpace(property.Value.MemberOf.Value.Value)) + { + errorReporter.ReportError(ErrorCondition.PropertyEmpty, $"Property element '{TDProperty.MemberOfName}' property has empty value.", property.Value.MemberOf.TokenIndex); + memberOfHasError = true; + } + else if (!memberOfHasError && !TryValidateMemberOfMatchesGroup(property.Value.MemberOf, propertyGroups, "Property", TDThing.PropertyGroupsName)) + { + memberOfHasError = true; + } + + if (memberOfHasError) + { + hasError = true; + } + } + + if (!TryValidatePropertyIri(property.Value.PropertyIri, dovContextPresent, "Property element", contextTokenIndex)) + { + hasError = true; + } + + if (!TryValidateDataSchema(property, (propName) => propName == TDProperty.ReadOnlyName || propName == TDProperty.PlaceholderName || propName == TDProperty.FormsName || propName == TDProperty.ContainsName || propName == TDProperty.ContainsLegacyName || propName == TDProperty.ContainedInName || propName == TDProperty.ContainedInLegacyName || propName == TDProperty.NamespaceName || propName == TDDataSchema.NamespaceLegacyName || propName == TDProperty.WithUnitName || propName == TDProperty.WithUnitLegacyName || propName == TDProperty.HasQuantityKindName || propName == TDProperty.MemberOfName || propName == TDProperty.MemberOfLegacyName || propName == TDProperty.PropertyIriName || propName == TDProperty.PropertyConfigurationName, dovContextPresent, protContextPresent, platContextPresent, contextTokenIndex, DataSchemaKind.Property, contentType)) { hasError = true; } @@ -1216,7 +1476,7 @@ private bool TryValidatePropertyForms(string name, ArrayTracker? forms, return !hasError; } - private bool TryValidateEvents(MapTracker? evts, MapTracker? properties, MapTracker? schemaDefinitions, HashSet serializationFormats, bool dovContextPresent, bool protContextPresent, bool platContextPresent, bool qudtContextPresent, long contextTokenIndex) + private bool TryValidateEvents(MapTracker? evts, MapTracker? properties, MapTracker? schemaDefinitions, ArrayTracker? eventGroups, HashSet serializationFormats, bool dovContextPresent, bool protContextPresent, bool platContextPresent, bool qudtContextPresent, long contextTokenIndex) { if (evts?.Entries == null) { @@ -1227,7 +1487,7 @@ private bool TryValidateEvents(MapTracker? evts, MapTracker foreach (KeyValuePair> evt in evts.Entries) { - if (!TryValidateEvent(evt.Key, evt.Value, properties, schemaDefinitions, out ValueTracker? contentType, dovContextPresent, protContextPresent, platContextPresent, qudtContextPresent, contextTokenIndex)) + if (!TryValidateEvent(evt.Key, evt.Value, properties, schemaDefinitions, eventGroups, out ValueTracker? contentType, dovContextPresent, protContextPresent, platContextPresent, qudtContextPresent, contextTokenIndex)) { hasError = true; } @@ -1251,7 +1511,7 @@ private bool TryValidateEvents(MapTracker? evts, MapTracker return !hasError; } - private bool TryValidateEvent(string name, ValueTracker evt, MapTracker? properties, MapTracker? schemaDefinitions, out ValueTracker? contentType, bool dovContextPresent, bool protContextPresent, bool platContextPresent, bool qudtContextPresent, long contextTokenIndex) + private bool TryValidateEvent(string name, ValueTracker evt, MapTracker? properties, MapTracker? schemaDefinitions, ArrayTracker? eventGroups, out ValueTracker? contentType, bool dovContextPresent, bool protContextPresent, bool platContextPresent, bool qudtContextPresent, long contextTokenIndex) { if (!TryValidateForms(evt.Value.Forms, FormsKind.Event, schemaDefinitions, out contentType, dovContextPresent, protContextPresent, contextTokenIndex)) { @@ -1347,6 +1607,35 @@ private bool TryValidateEvent(string name, ValueTracker evt, MapTracker } } + if (evt.Value.MemberOf != null) + { + bool memberOfHasError = false; + if (!TryValidateRequiredContext(evt.Value.MemberOfPrefixType, dovContextPresent, false, platContextPresent, $"Event element '{TDEvent.MemberOfName}' property", evt.Value.MemberOf.TokenIndex, contextTokenIndex)) + { + memberOfHasError = true; + } + + if (string.IsNullOrWhiteSpace(evt.Value.MemberOf.Value.Value)) + { + errorReporter.ReportError(ErrorCondition.PropertyEmpty, $"Event element '{TDEvent.MemberOfName}' property has empty value.", evt.Value.MemberOf.TokenIndex); + memberOfHasError = true; + } + else if (!memberOfHasError && !TryValidateMemberOfMatchesGroup(evt.Value.MemberOf, eventGroups, "Event", TDThing.EventGroupsName)) + { + memberOfHasError = true; + } + + if (memberOfHasError) + { + hasError = true; + } + } + + if (!TryValidatePropertyIri(evt.Value.PropertyIri, dovContextPresent, "Event element", contextTokenIndex)) + { + hasError = true; + } + if (evt.Value.Data != null && !TryValidateDataSchema(evt.Value.Data, null, dovContextPresent, protContextPresent, platContextPresent, contextTokenIndex, DataSchemaKind.Event, contentType)) { hasError = true; @@ -1406,28 +1695,35 @@ private bool TryValidateWithUnitProperty(ValueTracker withUnit, st return false; } - if (!withUnit.Value.Value.StartsWith(TDCommon.WithUnitPrefix)) + string[] withUnitParts = withUnit.Value.Value.Split('/', StringSplitOptions.RemoveEmptyEntries); + + if (withUnitParts.Length < 2) + { + errorReporter.ReportError(ErrorCondition.PropertyUnsupportedValue, $"{affordanceType} element '{TDCommon.WithUnitName}' property value '{withUnit.Value.Value}' must be a 2-level JSON Pointer, such as '/{TDThing.PropertiesName}/ExampleUnit'.", withUnit.TokenIndex); + return false; + } + + if (withUnitParts[0] != TDThing.PropertiesName) { - errorReporter.ReportError(ErrorCondition.PropertyUnsupportedValue, $"{affordanceType} element '{TDCommon.WithUnitName}' property value must start with '{TDCommon.WithUnitPrefix}'.", withUnit.TokenIndex); + errorReporter.ReportError(ErrorCondition.PropertyUnsupportedValue, $"{affordanceType} element '{TDCommon.WithUnitName}' property value '{withUnit.Value.Value}' must be a JSON Pointer whose first level is '{TDThing.PropertiesName}'.", withUnit.TokenIndex); return false; } - string unitPropName = withUnit.Value.Value.Substring(TDCommon.WithUnitPrefix.Length); - if (string.IsNullOrWhiteSpace(unitPropName)) + if (properties?.Entries == null) { - errorReporter.ReportError(ErrorCondition.PropertyUnsupportedValue, $"{affordanceType} element '{TDCommon.WithUnitName}' property has no referenced property name following '{TDCommon.WithUnitPrefix}'.", withUnit.TokenIndex); + errorReporter.ReportError(ErrorCondition.ItemNotFound, $"{affordanceType} element '{TDCommon.WithUnitName}' property has value '{withUnit.Value.Value}', but no '{TDThing.PropertiesName}' collection in Thing Model.", withUnit.TokenIndex); return false; } - if (!properties.Entries!.TryGetValue(unitPropName, out ValueTracker? unitProperty)) + if (!properties.Entries!.TryGetValue(withUnitParts[1], out ValueTracker? unitProperty)) { - errorReporter.ReportError(ErrorCondition.ItemNotFound, $"{affordanceType} element '{TDCommon.WithUnitName}' property references property '{unitPropName}', which is not present in 'properties' collection.", withUnit.TokenIndex, properties.TokenIndex); + errorReporter.ReportError(ErrorCondition.ItemNotFound, $"{affordanceType} element '{TDCommon.WithUnitName}' property has value '{withUnit.Value.Value}', but no '{withUnitParts[1]}' property in Thing Model.", withUnit.TokenIndex, properties.TokenIndex); return false; } if (unitProperty.Value.Type?.Value.Value != TDValues.TypeString) { - errorReporter.ReportError(ErrorCondition.TypeMismatch, $"{affordanceType} element '{TDCommon.WithUnitName}' property references property '{unitPropName}', but that property's schema is not of type string.", withUnit.TokenIndex, unitProperty.TokenIndex); + errorReporter.ReportError(ErrorCondition.TypeMismatch, $"{affordanceType} element '{TDCommon.WithUnitName}' property references property '{withUnitParts[1]}', but that property's schema is not of type string.", withUnit.TokenIndex, unitProperty.TokenIndex); return false; } diff --git a/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDAction.cs b/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDAction.cs index 3ba9429d5..5054a2ccb 100644 --- a/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDAction.cs +++ b/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDAction.cs @@ -17,8 +17,10 @@ public class TDAction : IEquatable, IDeserializable public const string FormsName = TDCommon.FormsName; public const string NamespaceName = TDCommon.NamespaceName; public const string NamespaceLegacyName = TDCommon.NamespaceLegacyName; - public const string MemberOfName = "dov:memberOf"; - public const string MemberOfLegacyName = "aov:memberOf"; + public const string MemberOfName = TDCommon.MemberOfName; + public const string MemberOfLegacyName = TDCommon.MemberOfLegacyName; + public const string PropertyIriName = TDCommon.PropertyIriName; + public const string ActionConfigurationName = "dov:actionConfiguration"; public static readonly HashSet SupportedProperties = new() { @@ -31,7 +33,9 @@ public class TDAction : IEquatable, IDeserializable NamespaceName, NamespaceLegacyName, MemberOfName, - MemberOfLegacyName + MemberOfLegacyName, + PropertyIriName, + ActionConfigurationName }; public ValueTracker? Description { get; set; } @@ -50,6 +54,10 @@ public class TDAction : IEquatable, IDeserializable public ValueTracker? MemberOf { get; set; } + public ValueTracker? PropertyIri { get; set; } + + public ValueTracker? ActionConfiguration { get; set; } + public Dictionary PropertyNames { get; set; } = new(); public PrefixType NamespacePrefixType { get; set; } = PrefixType.Indeterminate; @@ -71,13 +79,15 @@ public virtual bool Equals(TDAction? other) Safe == other.Safe && Forms == other.Forms && Namespace == other.Namespace && - MemberOf == other.MemberOf; + MemberOf == other.MemberOf && + PropertyIri == other.PropertyIri && + ActionConfiguration == other.ActionConfiguration; } } public override int GetHashCode() { - return (Description, Input, Output, Idempotent, Safe, Forms, Namespace, MemberOf).GetHashCode(); + return (Description, Input, Output, Idempotent, Safe, Forms, Namespace, MemberOf, PropertyIri, ActionConfiguration).GetHashCode(); } public static bool operator ==(TDAction? left, TDAction? right) @@ -175,6 +185,20 @@ public IEnumerable Traverse() yield return item; } } + if (PropertyIri != null) + { + foreach (ITraversable item in PropertyIri.Traverse()) + { + yield return item; + } + } + if (ActionConfiguration != null) + { + foreach (ITraversable item in ActionConfiguration.Traverse()) + { + yield return item; + } + } } public static TDAction Deserialize(ref Utf8JsonReader reader) @@ -230,6 +254,12 @@ public static TDAction Deserialize(ref Utf8JsonReader reader) action.MemberOf = ValueTracker.Deserialize(ref reader, MemberOfName); action.MemberOfPrefixType = PrefixType.AioPlatform; break; + case PropertyIriName: + action.PropertyIri = ValueTracker.Deserialize(ref reader, PropertyIriName); + break; + case ActionConfigurationName: + action.ActionConfiguration = ValueTracker.Deserialize(ref reader, ActionConfigurationName); + break; default: reader.Skip(); break; diff --git a/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDAffordanceGroup.cs b/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDAffordanceGroup.cs new file mode 100644 index 000000000..6f6fdab42 --- /dev/null +++ b/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDAffordanceGroup.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License + +namespace Azure.Iot.Operations.TDParser.Model +{ + using System; + using System.Collections.Generic; + using System.Text.Json; + + public class TDAffordanceGroup : IEquatable, IDeserializable + { + public const string TitleName = TDCommon.TitleName; + + public static readonly HashSet SupportedProperties = new() + { + TitleName + }; + + public ValueTracker? Title { get; set; } + + public Dictionary PropertyNames { get; set; } = new(); + + public virtual bool Equals(TDAffordanceGroup? other) + { + if (other == null) + { + return false; + } + else + { + return Title == other.Title; + } + } + + public override int GetHashCode() + { + return Title?.GetHashCode() ?? 0; + } + + public static bool operator ==(TDAffordanceGroup? left, TDAffordanceGroup? right) + { + if (left is null) + { + return right is null; + } + else + { + return left.Equals(right); + } + } + + public static bool operator !=(TDAffordanceGroup? left, TDAffordanceGroup? right) + { + return !(left == right); + } + + public override bool Equals(object? obj) + { + if (ReferenceEquals(this, obj)) + { + return true; + } + else if (ReferenceEquals(obj, null)) + { + return false; + } + else if (obj is not TDAffordanceGroup other) + { + return false; + } + else + { + return Equals(other); + } + } + + public IEnumerable Traverse() + { + if (Title != null) + { + foreach (ITraversable item in Title.Traverse()) + { + yield return item; + } + } + } + + public static TDAffordanceGroup Deserialize(ref Utf8JsonReader reader) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new InvalidOperationException($"expected JSON object but found {reader.TokenType}"); + } + + TDAffordanceGroup group = new(); + + reader.Read(); + while (reader.TokenType == JsonTokenType.PropertyName) + { + string propertyName = reader.GetString()!; + ParsingSupport.CheckForDuplicatePropertyName(ref reader, propertyName, group.PropertyNames, "affordance group"); + group.PropertyNames[propertyName] = reader.TokenStartIndex; + reader.Read(); + + switch (propertyName) + { + case TitleName: + group.Title = ValueTracker.Deserialize(ref reader, TitleName); + break; + default: + reader.Skip(); + break; + } + + reader.Read(); + } + + return group; + } + } +} diff --git a/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDAnything.cs b/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDAnything.cs new file mode 100644 index 000000000..4c4c6adb5 --- /dev/null +++ b/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDAnything.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License + +namespace Azure.Iot.Operations.TDParser.Model +{ + using System; + using System.Collections.Generic; + using System.Text.Json; + + public class TDAnything : IEquatable, IDeserializable + { + public Dictionary PropertyNames { get; set; } = new(); + + public virtual bool Equals(TDAnything? other) + { + return other != null; + } + + public override int GetHashCode() + { + return 0; + } + + public static bool operator ==(TDAnything? left, TDAnything? right) + { + if (left is null) + { + return right is null; + } + else + { + return left.Equals(right); + } + } + + public static bool operator !=(TDAnything? left, TDAnything? right) + { + return !(left == right); + } + + public override bool Equals(object? obj) + { + if (ReferenceEquals(this, obj)) + { + return true; + } + else if (ReferenceEquals(obj, null)) + { + return false; + } + else if (obj is not TDAnything other) + { + return false; + } + else + { + return Equals(other); + } + } + + public IEnumerable Traverse() + { + yield break; + } + + public static TDAnything Deserialize(ref Utf8JsonReader reader) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new InvalidOperationException($"expected JSON object but found {reader.TokenType}"); + } + + TDAnything anything = new(); + + reader.Read(); + while (reader.TokenType == JsonTokenType.PropertyName) + { + string propertyName = reader.GetString()!; + ParsingSupport.CheckForDuplicatePropertyName(ref reader, propertyName, anything.PropertyNames, "object"); + anything.PropertyNames[propertyName] = reader.TokenStartIndex; + reader.Read(); + reader.Skip(); + reader.Read(); + } + + return anything; + } + } +} diff --git a/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDCommon.cs b/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDCommon.cs index 3cdab2a16..4994602be 100644 --- a/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDCommon.cs +++ b/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDCommon.cs @@ -18,6 +18,9 @@ public static class TDCommon public const string WithUnitName = "dov:withUnit"; public const string WithUnitLegacyName = "aov:withUnit"; public const string HasQuantityKindName = "qudt:hasQuantityKind"; + public const string MemberOfName = "dov:memberOf"; + public const string MemberOfLegacyName = "aov:memberOf"; + public const string PropertyIriName = "dov:propertyIRI"; public const string WithUnitPrefix = "properties/"; } diff --git a/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDEvent.cs b/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDEvent.cs index 6c6b03c17..98a9e99c3 100644 --- a/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDEvent.cs +++ b/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDEvent.cs @@ -23,6 +23,10 @@ public class TDEvent : IEquatable, IDeserializable public const string WithUnitName = TDCommon.WithUnitName; public const string WithUnitLegacyName = TDCommon.WithUnitLegacyName; public const string HasQuantityKindName = TDCommon.HasQuantityKindName; + public const string MemberOfName = TDCommon.MemberOfName; + public const string MemberOfLegacyName = TDCommon.MemberOfLegacyName; + public const string PropertyIriName = TDCommon.PropertyIriName; + public const string EventConfigurationName = "dov:eventConfiguration"; public static readonly HashSet SupportedProperties = new() { @@ -39,7 +43,11 @@ public class TDEvent : IEquatable, IDeserializable NamespaceLegacyName, WithUnitName, WithUnitLegacyName, - HasQuantityKindName + HasQuantityKindName, + MemberOfName, + MemberOfLegacyName, + PropertyIriName, + EventConfigurationName }; public ValueTracker? Description { get; set; } @@ -62,6 +70,12 @@ public class TDEvent : IEquatable, IDeserializable public ValueTracker? HasQuantityKind { get; set; } + public ValueTracker? MemberOf { get; set; } + + public ValueTracker? PropertyIri { get; set; } + + public ValueTracker? EventConfiguration { get; set; } + public PrefixType PlaceholderPrefixType { get; set; } = PrefixType.Indeterminate; public PrefixType ContainsPrefixType { get; set; } = PrefixType.Indeterminate; @@ -72,6 +86,8 @@ public class TDEvent : IEquatable, IDeserializable public PrefixType WithUnitPrefixType { get; set; } = PrefixType.Indeterminate; + public PrefixType MemberOfPrefixType { get; set; } = PrefixType.Indeterminate; + public virtual bool Equals(TDEvent? other) { if (other == null) @@ -88,13 +104,16 @@ public virtual bool Equals(TDEvent? other) ContainedIn == other.ContainedIn && Namespace == other.Namespace && WithUnit == other.WithUnit && - HasQuantityKind == other.HasQuantityKind; + HasQuantityKind == other.HasQuantityKind && + MemberOf == other.MemberOf && + PropertyIri == other.PropertyIri && + EventConfiguration == other.EventConfiguration; } } public override int GetHashCode() { - return (Description, Data, Placeholder, Forms, Contains, ContainedIn, Namespace, WithUnit, HasQuantityKind).GetHashCode(); + return (Description, Data, Placeholder, Forms, Contains, ContainedIn, Namespace, WithUnit, HasQuantityKind, MemberOf, PropertyIri, EventConfiguration).GetHashCode(); } public static bool operator ==(TDEvent? left, TDEvent? right) @@ -199,6 +218,27 @@ public IEnumerable Traverse() yield return item; } } + if (MemberOf != null) + { + foreach (ITraversable item in MemberOf.Traverse()) + { + yield return item; + } + } + if (PropertyIri != null) + { + foreach (ITraversable item in PropertyIri.Traverse()) + { + yield return item; + } + } + if (EventConfiguration != null) + { + foreach (ITraversable item in EventConfiguration.Traverse()) + { + yield return item; + } + } } public static TDEvent Deserialize(ref Utf8JsonReader reader) @@ -272,6 +312,20 @@ public static TDEvent Deserialize(ref Utf8JsonReader reader) case HasQuantityKindName: evt.HasQuantityKind = ValueTracker.Deserialize(ref reader, HasQuantityKindName); break; + case MemberOfName: + evt.MemberOf = ValueTracker.Deserialize(ref reader, MemberOfName); + evt.MemberOfPrefixType = PrefixType.DoVocabulary; + break; + case MemberOfLegacyName: + evt.MemberOf = ValueTracker.Deserialize(ref reader, MemberOfName); + evt.MemberOfPrefixType = PrefixType.AioPlatform; + break; + case PropertyIriName: + evt.PropertyIri = ValueTracker.Deserialize(ref reader, PropertyIriName); + break; + case EventConfigurationName: + evt.EventConfiguration = ValueTracker.Deserialize(ref reader, EventConfigurationName); + break; default: reader.Skip(); break; diff --git a/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDProperty.cs b/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDProperty.cs index 4e7b27d42..76c95d4f1 100644 --- a/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDProperty.cs +++ b/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDProperty.cs @@ -20,6 +20,10 @@ public class TDProperty : TDDataSchema, IEquatable, IDeserializable< public const string WithUnitName = TDCommon.WithUnitName; public const string WithUnitLegacyName = TDCommon.WithUnitLegacyName; public const string HasQuantityKindName = TDCommon.HasQuantityKindName; + public const string MemberOfName = TDCommon.MemberOfName; + public const string MemberOfLegacyName = TDCommon.MemberOfLegacyName; + public const string PropertyIriName = TDCommon.PropertyIriName; + public const string PropertyConfigurationName = "dov:propertyConfiguration"; public static new readonly HashSet SupportedProperties = new() { @@ -33,7 +37,11 @@ public class TDProperty : TDDataSchema, IEquatable, IDeserializable< ContainedInLegacyName, WithUnitName, WithUnitLegacyName, - HasQuantityKindName + HasQuantityKindName, + MemberOfName, + MemberOfLegacyName, + PropertyIriName, + PropertyConfigurationName }; public ValueTracker? ReadOnly { get; set; } @@ -50,6 +58,12 @@ public class TDProperty : TDDataSchema, IEquatable, IDeserializable< public ValueTracker? HasQuantityKind { get; set; } + public ValueTracker? MemberOf { get; set; } + + public ValueTracker? PropertyIri { get; set; } + + public ValueTracker? PropertyConfiguration { get; set; } + public PrefixType PlaceholderPrefixType { get; set; } = PrefixType.Indeterminate; public PrefixType ContainsPrefixType { get; set; } = PrefixType.Indeterminate; @@ -58,6 +72,8 @@ public class TDProperty : TDDataSchema, IEquatable, IDeserializable< public PrefixType WithUnitPrefixType { get; set; } = PrefixType.Indeterminate; + public PrefixType MemberOfPrefixType { get; set; } = PrefixType.Indeterminate; + public virtual bool Equals(TDProperty? other) { if (other == null) @@ -73,13 +89,16 @@ public virtual bool Equals(TDProperty? other) Contains == other.Contains && ContainedIn == other.ContainedIn && WithUnit == other.WithUnit && - HasQuantityKind == other.HasQuantityKind; + HasQuantityKind == other.HasQuantityKind && + MemberOf == other.MemberOf && + PropertyIri == other.PropertyIri && + PropertyConfiguration == other.PropertyConfiguration; } } public override int GetHashCode() { - return (base.GetHashCode(), ReadOnly, Placeholder, Forms, Contains, ContainedIn, WithUnit, HasQuantityKind).GetHashCode(); + return (base.GetHashCode(), ReadOnly, Placeholder, Forms, Contains, ContainedIn, WithUnit, HasQuantityKind, MemberOf, PropertyIri, PropertyConfiguration).GetHashCode(); } public static bool operator ==(TDProperty? left, TDProperty? right) @@ -175,6 +194,27 @@ public override IEnumerable Traverse() yield return item; } } + if (MemberOf != null) + { + foreach (ITraversable item in MemberOf.Traverse()) + { + yield return item; + } + } + if (PropertyIri != null) + { + foreach (ITraversable item in PropertyIri.Traverse()) + { + yield return item; + } + } + if (PropertyConfiguration != null) + { + foreach (ITraversable item in PropertyConfiguration.Traverse()) + { + yield return item; + } + } } public static new TDProperty Deserialize(ref Utf8JsonReader reader) @@ -239,6 +279,20 @@ public override IEnumerable Traverse() case HasQuantityKindName: prop.HasQuantityKind = ValueTracker.Deserialize(ref reader, HasQuantityKindName); break; + case MemberOfName: + prop.MemberOf = ValueTracker.Deserialize(ref reader, MemberOfName); + prop.MemberOfPrefixType = PrefixType.DoVocabulary; + break; + case MemberOfLegacyName: + prop.MemberOf = ValueTracker.Deserialize(ref reader, MemberOfName); + prop.MemberOfPrefixType = PrefixType.AioPlatform; + break; + case PropertyIriName: + prop.PropertyIri = ValueTracker.Deserialize(ref reader, PropertyIriName); + break; + case PropertyConfigurationName: + prop.PropertyConfiguration = ValueTracker.Deserialize(ref reader, PropertyConfigurationName); + break; default: reader.Skip(); break; diff --git a/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDThing.cs b/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDThing.cs index 9426d77b2..b0bff96cf 100644 --- a/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDThing.cs +++ b/wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDThing.cs @@ -26,6 +26,10 @@ public class TDThing : IEquatable, IDeserializable public const string IsEventLegacyName = "aov:isEvent"; public const string TypeRefName = "dov:typeRef"; public const string TypeRefLegacyName = "aov:typeRef"; + public const string MetadataName = "dov:metadata"; + public const string PropertyGroupsName = "dov:propertyGroups"; + public const string EventGroupsName = "dov:eventGroups"; + public const string ActionGroupsName = "dov:actionGroups"; public static readonly HashSet SupportedProperties = new() { @@ -45,7 +49,11 @@ public class TDThing : IEquatable, IDeserializable IsEventName, IsEventLegacyName, TypeRefName, - TypeRefLegacyName + TypeRefLegacyName, + MetadataName, + PropertyGroupsName, + EventGroupsName, + ActionGroupsName }; public ArrayTracker? Context { get; set; } @@ -76,6 +84,14 @@ public class TDThing : IEquatable, IDeserializable public ValueTracker? TypeRef { get; set; } + public ValueTracker? Metadata { get; set; } + + public ArrayTracker? PropertyGroups { get; set; } + + public ArrayTracker? EventGroups { get; set; } + + public ArrayTracker? ActionGroups { get; set; } + public Dictionary PropertyNames { get; set; } = new(); public PrefixType IsCompositePrefixType { get; set; } = PrefixType.Indeterminate; @@ -105,13 +121,17 @@ public virtual bool Equals(TDThing? other) Events == other.Events && IsComposite == other.IsComposite && IsEvent == other.IsEvent && - TypeRef == other.TypeRef; + TypeRef == other.TypeRef && + Metadata == other.Metadata && + PropertyGroups == other.PropertyGroups && + EventGroups == other.EventGroups && + ActionGroups == other.ActionGroups; } } public override int GetHashCode() { - return (Context, Type, Title, Description, Links, SchemaDefinitions, Forms, Optional, Actions, Properties, Events, IsComposite, IsEvent, TypeRef).GetHashCode(); + return (Context, Type, Title, Description, Links, SchemaDefinitions, Forms, Optional, Actions, Properties, Events, IsComposite, IsEvent, TypeRef, Metadata, PropertyGroups, EventGroups, ActionGroups).GetHashCode(); } public static bool operator ==(TDThing? left, TDThing? right) @@ -251,6 +271,34 @@ public IEnumerable Traverse() yield return item; } } + if (Metadata != null) + { + foreach (ITraversable item in Metadata.Traverse()) + { + yield return item; + } + } + if (PropertyGroups != null) + { + foreach (ITraversable item in PropertyGroups.Traverse()) + { + yield return item; + } + } + if (EventGroups != null) + { + foreach (ITraversable item in EventGroups.Traverse()) + { + yield return item; + } + } + if (ActionGroups != null) + { + foreach (ITraversable item in ActionGroups.Traverse()) + { + yield return item; + } + } } public static TDThing Deserialize(ref Utf8JsonReader reader) @@ -329,6 +377,18 @@ public static TDThing Deserialize(ref Utf8JsonReader reader) thing.TypeRef = ValueTracker.Deserialize(ref reader, TypeRefName); thing.TypeRefPrefixType = PrefixType.AioPlatform; break; + case MetadataName: + thing.Metadata = ValueTracker.Deserialize(ref reader, MetadataName); + break; + case PropertyGroupsName: + thing.PropertyGroups = ArrayTracker.Deserialize(ref reader, PropertyGroupsName); + break; + case EventGroupsName: + thing.EventGroups = ArrayTracker.Deserialize(ref reader, EventGroupsName); + break; + case ActionGroupsName: + thing.ActionGroups = ArrayTracker.Deserialize(ref reader, ActionGroupsName); + break; default: reader.Skip(); break; diff --git a/wot-codegen/test/test-cases/failure/ActionActionConfigurationWrongType.json b/wot-codegen/test/test-cases/failure/ActionActionConfigurationWrongType.json new file mode 100644 index 000000000..940f27740 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ActionActionConfigurationWrongType.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ActionActionConfigurationWrongType.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "JsonInvalid", + "filename": "ActionActionConfigurationWrongType.TM.json", + "line": 10, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ActionEventConfigurationMismatch.json b/wot-codegen/test/test-cases/failure/ActionEventConfigurationMismatch.json new file mode 100644 index 000000000..d32e8774e --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ActionEventConfigurationMismatch.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ActionEventConfigurationMismatch.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "PropertyUnsupported", + "filename": "ActionEventConfigurationMismatch.TM.json", + "line": 10, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ActionMemberOfMatchesEventGroup.json b/wot-codegen/test/test-cases/failure/ActionMemberOfMatchesEventGroup.json new file mode 100644 index 000000000..a46a5c721 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ActionMemberOfMatchesEventGroup.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ActionMemberOfMatchesEventGroup.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "ItemNotFound", + "filename": "ActionMemberOfMatchesEventGroup.TM.json", + "line": 13, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ActionMemberOfMatchesPropertyGroup.json b/wot-codegen/test/test-cases/failure/ActionMemberOfMatchesPropertyGroup.json new file mode 100644 index 000000000..b39604232 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ActionMemberOfMatchesPropertyGroup.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ActionMemberOfMatchesPropertyGroup.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "ItemNotFound", + "filename": "ActionMemberOfMatchesPropertyGroup.TM.json", + "line": 13, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ActionMemberOfUnknownGroup.json b/wot-codegen/test/test-cases/failure/ActionMemberOfUnknownGroup.json new file mode 100644 index 000000000..43e1942d8 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ActionMemberOfUnknownGroup.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ActionMemberOfUnknownGroup.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "ItemNotFound", + "filename": "ActionMemberOfUnknownGroup.TM.json", + "line": 13, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ActionPropertyConfigurationMismatch.json b/wot-codegen/test/test-cases/failure/ActionPropertyConfigurationMismatch.json new file mode 100644 index 000000000..f1e22fdae --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ActionPropertyConfigurationMismatch.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ActionPropertyConfigurationMismatch.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "PropertyUnsupported", + "filename": "ActionPropertyConfigurationMismatch.TM.json", + "line": 10, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ActionPropertyIriEmpty.json b/wot-codegen/test/test-cases/failure/ActionPropertyIriEmpty.json new file mode 100644 index 000000000..dab880e69 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ActionPropertyIriEmpty.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ActionPropertyIriEmpty.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "PropertyEmpty", + "filename": "ActionPropertyIriEmpty.TM.json", + "line": 10, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/EventMemberOf.json b/wot-codegen/test/test-cases/failure/EventActionConfigurationMismatch.json similarity index 58% rename from wot-codegen/test/test-cases/failure/EventMemberOf.json rename to wot-codegen/test/test-cases/failure/EventActionConfigurationMismatch.json index 0a4a6ed12..770d54de7 100644 --- a/wot-codegen/test/test-cases/failure/EventMemberOf.json +++ b/wot-codegen/test/test-cases/failure/EventActionConfigurationMismatch.json @@ -1,13 +1,13 @@ { "success": false, "commandLine": { - "things": [ "invalidAioBinding/EventMemberOf.TM.json" ], + "things": [ "invalidAioBinding/EventActionConfigurationMismatch.TM.json" ], "lang": "none" }, "errors": [ { "condition": "PropertyUnsupported", - "filename": "EventMemberOf.TM.json", + "filename": "EventActionConfigurationMismatch.TM.json", "line": 17, "cfLine": 0, "crossRef": "" diff --git a/wot-codegen/test/test-cases/failure/EventEventConfigurationWrongType.json b/wot-codegen/test/test-cases/failure/EventEventConfigurationWrongType.json new file mode 100644 index 000000000..78004135b --- /dev/null +++ b/wot-codegen/test/test-cases/failure/EventEventConfigurationWrongType.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/EventEventConfigurationWrongType.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "JsonInvalid", + "filename": "EventEventConfigurationWrongType.TM.json", + "line": 17, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/EventMemberOfMatchesActionGroup.json b/wot-codegen/test/test-cases/failure/EventMemberOfMatchesActionGroup.json new file mode 100644 index 000000000..5bbc33d47 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/EventMemberOfMatchesActionGroup.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/EventMemberOfMatchesActionGroup.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "ItemNotFound", + "filename": "EventMemberOfMatchesActionGroup.TM.json", + "line": 20, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/EventMemberOfMatchesPropertyGroup.json b/wot-codegen/test/test-cases/failure/EventMemberOfMatchesPropertyGroup.json new file mode 100644 index 000000000..42bc16a52 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/EventMemberOfMatchesPropertyGroup.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/EventMemberOfMatchesPropertyGroup.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "ItemNotFound", + "filename": "EventMemberOfMatchesPropertyGroup.TM.json", + "line": 20, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/EventMemberOfUnknownGroup.json b/wot-codegen/test/test-cases/failure/EventMemberOfUnknownGroup.json new file mode 100644 index 000000000..58ab598fe --- /dev/null +++ b/wot-codegen/test/test-cases/failure/EventMemberOfUnknownGroup.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/EventMemberOfUnknownGroup.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "ItemNotFound", + "filename": "EventMemberOfUnknownGroup.TM.json", + "line": 20, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/EventPropertyConfigurationMismatch.json b/wot-codegen/test/test-cases/failure/EventPropertyConfigurationMismatch.json new file mode 100644 index 000000000..e67c35b90 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/EventPropertyConfigurationMismatch.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/EventPropertyConfigurationMismatch.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "PropertyUnsupported", + "filename": "EventPropertyConfigurationMismatch.TM.json", + "line": 17, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/EventPropertyIriEmpty.json b/wot-codegen/test/test-cases/failure/EventPropertyIriEmpty.json new file mode 100644 index 000000000..9a2c1b206 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/EventPropertyIriEmpty.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/EventPropertyIriEmpty.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "PropertyEmpty", + "filename": "EventPropertyIriEmpty.TM.json", + "line": 17, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/OptionalActionNotFound.json b/wot-codegen/test/test-cases/failure/OptionalActionNotFound.json new file mode 100644 index 000000000..7c5c944c3 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/OptionalActionNotFound.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/OptionalActionNotFound.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "ItemNotFound", + "filename": "OptionalActionNotFound.TM.json", + "line": 9, + "cfLine": 11, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/OptionalEmpty.json b/wot-codegen/test/test-cases/failure/OptionalEmpty.json new file mode 100644 index 000000000..0ea7309ac --- /dev/null +++ b/wot-codegen/test/test-cases/failure/OptionalEmpty.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/OptionalEmpty.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "PropertyEmpty", + "filename": "OptionalEmpty.TM.json", + "line": 9, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/OptionalEventNotFound.json b/wot-codegen/test/test-cases/failure/OptionalEventNotFound.json new file mode 100644 index 000000000..f6b057532 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/OptionalEventNotFound.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/OptionalEventNotFound.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "ItemNotFound", + "filename": "OptionalEventNotFound.TM.json", + "line": 9, + "cfLine": 15, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/OptionalInvalidFirstSegment.json b/wot-codegen/test/test-cases/failure/OptionalInvalidFirstSegment.json new file mode 100644 index 000000000..59b013161 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/OptionalInvalidFirstSegment.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/OptionalInvalidFirstSegment.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "PropertyUnsupportedValue", + "filename": "OptionalInvalidFirstSegment.TM.json", + "line": 9, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/OptionalJsonPointerTooShort.json b/wot-codegen/test/test-cases/failure/OptionalJsonPointerTooShort.json new file mode 100644 index 000000000..3a05aeb5b --- /dev/null +++ b/wot-codegen/test/test-cases/failure/OptionalJsonPointerTooShort.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/OptionalJsonPointerTooShort.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "PropertyUnsupportedValue", + "filename": "OptionalJsonPointerTooShort.TM.json", + "line": 9, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/OptionalNoActionsCollection.json b/wot-codegen/test/test-cases/failure/OptionalNoActionsCollection.json new file mode 100644 index 000000000..cd79ade86 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/OptionalNoActionsCollection.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/OptionalNoActionsCollection.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "ItemNotFound", + "filename": "OptionalNoActionsCollection.TM.json", + "line": 9, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/OptionalNoEventsCollection.json b/wot-codegen/test/test-cases/failure/OptionalNoEventsCollection.json new file mode 100644 index 000000000..4c150a5c6 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/OptionalNoEventsCollection.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/OptionalNoEventsCollection.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "ItemNotFound", + "filename": "OptionalNoEventsCollection.TM.json", + "line": 9, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/OptionalNoPropertiesCollection.json b/wot-codegen/test/test-cases/failure/OptionalNoPropertiesCollection.json new file mode 100644 index 000000000..ca1884ed7 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/OptionalNoPropertiesCollection.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/OptionalNoPropertiesCollection.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "ItemNotFound", + "filename": "OptionalNoPropertiesCollection.TM.json", + "line": 9, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/OptionalPropertyNotFound.json b/wot-codegen/test/test-cases/failure/OptionalPropertyNotFound.json new file mode 100644 index 000000000..df6b2d779 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/OptionalPropertyNotFound.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/OptionalPropertyNotFound.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "ItemNotFound", + "filename": "OptionalPropertyNotFound.TM.json", + "line": 9, + "cfLine": 13, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/PropertyActionConfigurationMismatch.json b/wot-codegen/test/test-cases/failure/PropertyActionConfigurationMismatch.json new file mode 100644 index 000000000..85218919f --- /dev/null +++ b/wot-codegen/test/test-cases/failure/PropertyActionConfigurationMismatch.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/PropertyActionConfigurationMismatch.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "PropertyUnsupported", + "filename": "PropertyActionConfigurationMismatch.TM.json", + "line": 13, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/PropertyMemberOf.json b/wot-codegen/test/test-cases/failure/PropertyEventConfigurationMismatch.json similarity index 57% rename from wot-codegen/test/test-cases/failure/PropertyMemberOf.json rename to wot-codegen/test/test-cases/failure/PropertyEventConfigurationMismatch.json index d82a73de6..a74671a84 100644 --- a/wot-codegen/test/test-cases/failure/PropertyMemberOf.json +++ b/wot-codegen/test/test-cases/failure/PropertyEventConfigurationMismatch.json @@ -1,13 +1,13 @@ { "success": false, "commandLine": { - "things": [ "invalidAioBinding/PropertyMemberOf.TM.json" ], + "things": [ "invalidAioBinding/PropertyEventConfigurationMismatch.TM.json" ], "lang": "none" }, "errors": [ { "condition": "PropertyUnsupported", - "filename": "PropertyMemberOf.TM.json", + "filename": "PropertyEventConfigurationMismatch.TM.json", "line": 13, "cfLine": 0, "crossRef": "" diff --git a/wot-codegen/test/test-cases/failure/PropertyMemberOfMatchesActionGroup.json b/wot-codegen/test/test-cases/failure/PropertyMemberOfMatchesActionGroup.json new file mode 100644 index 000000000..1157933e8 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/PropertyMemberOfMatchesActionGroup.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/PropertyMemberOfMatchesActionGroup.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "ItemNotFound", + "filename": "PropertyMemberOfMatchesActionGroup.TM.json", + "line": 16, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/PropertyMemberOfMatchesEventGroup.json b/wot-codegen/test/test-cases/failure/PropertyMemberOfMatchesEventGroup.json new file mode 100644 index 000000000..ad6b8b2bc --- /dev/null +++ b/wot-codegen/test/test-cases/failure/PropertyMemberOfMatchesEventGroup.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/PropertyMemberOfMatchesEventGroup.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "ItemNotFound", + "filename": "PropertyMemberOfMatchesEventGroup.TM.json", + "line": 16, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/PropertyMemberOfUnknownGroup.json b/wot-codegen/test/test-cases/failure/PropertyMemberOfUnknownGroup.json new file mode 100644 index 000000000..9bfb18eaa --- /dev/null +++ b/wot-codegen/test/test-cases/failure/PropertyMemberOfUnknownGroup.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/PropertyMemberOfUnknownGroup.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "ItemNotFound", + "filename": "PropertyMemberOfUnknownGroup.TM.json", + "line": 16, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/PropertyPropertyConfigurationWrongType.json b/wot-codegen/test/test-cases/failure/PropertyPropertyConfigurationWrongType.json new file mode 100644 index 000000000..88e7f2cc4 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/PropertyPropertyConfigurationWrongType.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/PropertyPropertyConfigurationWrongType.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "JsonInvalid", + "filename": "PropertyPropertyConfigurationWrongType.TM.json", + "line": 13, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/PropertyPropertyIriEmpty.json b/wot-codegen/test/test-cases/failure/PropertyPropertyIriEmpty.json new file mode 100644 index 000000000..4866f7e2b --- /dev/null +++ b/wot-codegen/test/test-cases/failure/PropertyPropertyIriEmpty.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/PropertyPropertyIriEmpty.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "PropertyEmpty", + "filename": "PropertyPropertyIriEmpty.TM.json", + "line": 13, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ThingActionGroupsDuplicateTitle.json b/wot-codegen/test/test-cases/failure/ThingActionGroupsDuplicateTitle.json new file mode 100644 index 000000000..11d2f528a --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ThingActionGroupsDuplicateTitle.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ThingActionGroupsDuplicateTitle.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "Duplication", + "filename": "ThingActionGroupsDuplicateTitle.TM.json", + "line": 10, + "cfLine": 14, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ThingActionGroupsMissingTitle.json b/wot-codegen/test/test-cases/failure/ThingActionGroupsMissingTitle.json new file mode 100644 index 000000000..56d3c0b1a --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ThingActionGroupsMissingTitle.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ThingActionGroupsMissingTitle.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "PropertyMissing", + "filename": "ThingActionGroupsMissingTitle.TM.json", + "line": 9, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ThingActionGroupsTitleEmpty.json b/wot-codegen/test/test-cases/failure/ThingActionGroupsTitleEmpty.json new file mode 100644 index 000000000..2fc763621 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ThingActionGroupsTitleEmpty.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ThingActionGroupsTitleEmpty.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "PropertyEmpty", + "filename": "ThingActionGroupsTitleEmpty.TM.json", + "line": 10, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ThingActionGroupsTitleWrongType.json b/wot-codegen/test/test-cases/failure/ThingActionGroupsTitleWrongType.json new file mode 100644 index 000000000..b0155bc96 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ThingActionGroupsTitleWrongType.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ThingActionGroupsTitleWrongType.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "JsonInvalid", + "filename": "ThingActionGroupsTitleWrongType.TM.json", + "line": 10, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ThingActionGroupsWrongType.json b/wot-codegen/test/test-cases/failure/ThingActionGroupsWrongType.json new file mode 100644 index 000000000..3a949fab6 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ThingActionGroupsWrongType.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ThingActionGroupsWrongType.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "JsonInvalid", + "filename": "ThingActionGroupsWrongType.TM.json", + "line": 9, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ThingEventActionGroupsDuplicateTitle.json b/wot-codegen/test/test-cases/failure/ThingEventActionGroupsDuplicateTitle.json new file mode 100644 index 000000000..023a68fe1 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ThingEventActionGroupsDuplicateTitle.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ThingEventActionGroupsDuplicateTitle.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "Duplication", + "filename": "ThingEventActionGroupsDuplicateTitle.TM.json", + "line": 10, + "cfLine": 16, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ThingEventGroupsDuplicateTitle.json b/wot-codegen/test/test-cases/failure/ThingEventGroupsDuplicateTitle.json new file mode 100644 index 000000000..38d9735e5 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ThingEventGroupsDuplicateTitle.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ThingEventGroupsDuplicateTitle.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "Duplication", + "filename": "ThingEventGroupsDuplicateTitle.TM.json", + "line": 10, + "cfLine": 14, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ThingEventGroupsMissingTitle.json b/wot-codegen/test/test-cases/failure/ThingEventGroupsMissingTitle.json new file mode 100644 index 000000000..0d467347d --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ThingEventGroupsMissingTitle.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ThingEventGroupsMissingTitle.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "PropertyMissing", + "filename": "ThingEventGroupsMissingTitle.TM.json", + "line": 9, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ThingEventGroupsTitleEmpty.json b/wot-codegen/test/test-cases/failure/ThingEventGroupsTitleEmpty.json new file mode 100644 index 000000000..451465e14 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ThingEventGroupsTitleEmpty.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ThingEventGroupsTitleEmpty.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "PropertyEmpty", + "filename": "ThingEventGroupsTitleEmpty.TM.json", + "line": 10, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ThingEventGroupsTitleWrongType.json b/wot-codegen/test/test-cases/failure/ThingEventGroupsTitleWrongType.json new file mode 100644 index 000000000..7c797eb0b --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ThingEventGroupsTitleWrongType.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ThingEventGroupsTitleWrongType.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "JsonInvalid", + "filename": "ThingEventGroupsTitleWrongType.TM.json", + "line": 10, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ThingEventGroupsWrongType.json b/wot-codegen/test/test-cases/failure/ThingEventGroupsWrongType.json new file mode 100644 index 000000000..e1ae2566a --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ThingEventGroupsWrongType.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ThingEventGroupsWrongType.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "JsonInvalid", + "filename": "ThingEventGroupsWrongType.TM.json", + "line": 9, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ThingMetadataWrongType.json b/wot-codegen/test/test-cases/failure/ThingMetadataWrongType.json new file mode 100644 index 000000000..781af66f7 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ThingMetadataWrongType.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ThingMetadataWrongType.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "JsonInvalid", + "filename": "ThingMetadataWrongType.TM.json", + "line": 8, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ThingPropertyActionGroupsDuplicateTitle.json b/wot-codegen/test/test-cases/failure/ThingPropertyActionGroupsDuplicateTitle.json new file mode 100644 index 000000000..f1841f445 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ThingPropertyActionGroupsDuplicateTitle.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ThingPropertyActionGroupsDuplicateTitle.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "Duplication", + "filename": "ThingPropertyActionGroupsDuplicateTitle.TM.json", + "line": 10, + "cfLine": 16, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ThingPropertyEventGroupsDuplicateTitle.json b/wot-codegen/test/test-cases/failure/ThingPropertyEventGroupsDuplicateTitle.json new file mode 100644 index 000000000..e3f4bccc3 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ThingPropertyEventGroupsDuplicateTitle.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ThingPropertyEventGroupsDuplicateTitle.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "Duplication", + "filename": "ThingPropertyEventGroupsDuplicateTitle.TM.json", + "line": 10, + "cfLine": 16, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ThingPropertyGroupsDuplicateTitle.json b/wot-codegen/test/test-cases/failure/ThingPropertyGroupsDuplicateTitle.json new file mode 100644 index 000000000..a4ffb8f44 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ThingPropertyGroupsDuplicateTitle.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ThingPropertyGroupsDuplicateTitle.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "Duplication", + "filename": "ThingPropertyGroupsDuplicateTitle.TM.json", + "line": 10, + "cfLine": 14, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ThingPropertyGroupsMissingTitle.json b/wot-codegen/test/test-cases/failure/ThingPropertyGroupsMissingTitle.json new file mode 100644 index 000000000..f52cadfa1 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ThingPropertyGroupsMissingTitle.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ThingPropertyGroupsMissingTitle.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "PropertyMissing", + "filename": "ThingPropertyGroupsMissingTitle.TM.json", + "line": 9, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ThingPropertyGroupsTitleEmpty.json b/wot-codegen/test/test-cases/failure/ThingPropertyGroupsTitleEmpty.json new file mode 100644 index 000000000..97d6d74eb --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ThingPropertyGroupsTitleEmpty.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ThingPropertyGroupsTitleEmpty.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "PropertyEmpty", + "filename": "ThingPropertyGroupsTitleEmpty.TM.json", + "line": 10, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ThingPropertyGroupsTitleWrongType.json b/wot-codegen/test/test-cases/failure/ThingPropertyGroupsTitleWrongType.json new file mode 100644 index 000000000..0c3daec85 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ThingPropertyGroupsTitleWrongType.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ThingPropertyGroupsTitleWrongType.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "JsonInvalid", + "filename": "ThingPropertyGroupsTitleWrongType.TM.json", + "line": 10, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/failure/ThingPropertyGroupsWrongType.json b/wot-codegen/test/test-cases/failure/ThingPropertyGroupsWrongType.json new file mode 100644 index 000000000..84d5ad394 --- /dev/null +++ b/wot-codegen/test/test-cases/failure/ThingPropertyGroupsWrongType.json @@ -0,0 +1,16 @@ +{ + "success": false, + "commandLine": { + "things": [ "invalidAioBinding/ThingPropertyGroupsWrongType.TM.json" ], + "lang": "none" + }, + "errors": [ + { + "condition": "JsonInvalid", + "filename": "ThingPropertyGroupsWrongType.TM.json", + "line": 9, + "cfLine": 0, + "crossRef": "" + } + ] +} diff --git a/wot-codegen/test/test-cases/success/ActionActionConfiguration.json b/wot-codegen/test/test-cases/success/ActionActionConfiguration.json new file mode 100644 index 000000000..e40d0145d --- /dev/null +++ b/wot-codegen/test/test-cases/success/ActionActionConfiguration.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/ActionActionConfiguration.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/ActionMemberOfMatchesGroup.json b/wot-codegen/test/test-cases/success/ActionMemberOfMatchesGroup.json new file mode 100644 index 000000000..29544272e --- /dev/null +++ b/wot-codegen/test/test-cases/success/ActionMemberOfMatchesGroup.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/ActionMemberOfMatchesGroup.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/ActionPropertyIri.json b/wot-codegen/test/test-cases/success/ActionPropertyIri.json new file mode 100644 index 000000000..7fe2734b2 --- /dev/null +++ b/wot-codegen/test/test-cases/success/ActionPropertyIri.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/ActionPropertyIri.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/EventEventConfiguration.json b/wot-codegen/test/test-cases/success/EventEventConfiguration.json new file mode 100644 index 000000000..e6dd5d282 --- /dev/null +++ b/wot-codegen/test/test-cases/success/EventEventConfiguration.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/EventEventConfiguration.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/EventMemberOf.json b/wot-codegen/test/test-cases/success/EventMemberOf.json new file mode 100644 index 000000000..bcd9ff6a4 --- /dev/null +++ b/wot-codegen/test/test-cases/success/EventMemberOf.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/EventMemberOf.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/EventMemberOfMatchesGroup.json b/wot-codegen/test/test-cases/success/EventMemberOfMatchesGroup.json new file mode 100644 index 000000000..cace7a7bc --- /dev/null +++ b/wot-codegen/test/test-cases/success/EventMemberOfMatchesGroup.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/EventMemberOfMatchesGroup.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/EventPropertyIri.json b/wot-codegen/test/test-cases/success/EventPropertyIri.json new file mode 100644 index 000000000..2c72fcd67 --- /dev/null +++ b/wot-codegen/test/test-cases/success/EventPropertyIri.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/EventPropertyIri.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/OptionalAction.json b/wot-codegen/test/test-cases/success/OptionalAction.json new file mode 100644 index 000000000..eb1ec4941 --- /dev/null +++ b/wot-codegen/test/test-cases/success/OptionalAction.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/OptionalAction.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/OptionalEvent.json b/wot-codegen/test/test-cases/success/OptionalEvent.json new file mode 100644 index 000000000..ce52251ac --- /dev/null +++ b/wot-codegen/test/test-cases/success/OptionalEvent.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/OptionalEvent.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/OptionalProperty.json b/wot-codegen/test/test-cases/success/OptionalProperty.json new file mode 100644 index 000000000..e3b0aa1f6 --- /dev/null +++ b/wot-codegen/test/test-cases/success/OptionalProperty.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/OptionalProperty.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/PropertyMemberOf.json b/wot-codegen/test/test-cases/success/PropertyMemberOf.json new file mode 100644 index 000000000..ca0139660 --- /dev/null +++ b/wot-codegen/test/test-cases/success/PropertyMemberOf.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/PropertyMemberOf.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/PropertyMemberOfMatchesGroup.json b/wot-codegen/test/test-cases/success/PropertyMemberOfMatchesGroup.json new file mode 100644 index 000000000..9ae7cc15a --- /dev/null +++ b/wot-codegen/test/test-cases/success/PropertyMemberOfMatchesGroup.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/PropertyMemberOfMatchesGroup.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/PropertyPropertyConfiguration.json b/wot-codegen/test/test-cases/success/PropertyPropertyConfiguration.json new file mode 100644 index 000000000..8cb165799 --- /dev/null +++ b/wot-codegen/test/test-cases/success/PropertyPropertyConfiguration.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/PropertyPropertyConfiguration.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/PropertyPropertyIri.json b/wot-codegen/test/test-cases/success/PropertyPropertyIri.json new file mode 100644 index 000000000..2f066f46f --- /dev/null +++ b/wot-codegen/test/test-cases/success/PropertyPropertyIri.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/PropertyPropertyIri.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/ThingActionGroupsMulti.json b/wot-codegen/test/test-cases/success/ThingActionGroupsMulti.json new file mode 100644 index 000000000..4b6c09452 --- /dev/null +++ b/wot-codegen/test/test-cases/success/ThingActionGroupsMulti.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/ThingActionGroupsMulti.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/ThingActionGroupsSingle.json b/wot-codegen/test/test-cases/success/ThingActionGroupsSingle.json new file mode 100644 index 000000000..2cac5c23d --- /dev/null +++ b/wot-codegen/test/test-cases/success/ThingActionGroupsSingle.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/ThingActionGroupsSingle.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/ThingEventGroupsMulti.json b/wot-codegen/test/test-cases/success/ThingEventGroupsMulti.json new file mode 100644 index 000000000..7e249dd7c --- /dev/null +++ b/wot-codegen/test/test-cases/success/ThingEventGroupsMulti.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/ThingEventGroupsMulti.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/ThingEventGroupsSingle.json b/wot-codegen/test/test-cases/success/ThingEventGroupsSingle.json new file mode 100644 index 000000000..7ca69a6fa --- /dev/null +++ b/wot-codegen/test/test-cases/success/ThingEventGroupsSingle.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/ThingEventGroupsSingle.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/ThingMetadata.json b/wot-codegen/test/test-cases/success/ThingMetadata.json new file mode 100644 index 000000000..0e44cbeb3 --- /dev/null +++ b/wot-codegen/test/test-cases/success/ThingMetadata.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/ThingMetadata.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/ThingPropertyGroupsMulti.json b/wot-codegen/test/test-cases/success/ThingPropertyGroupsMulti.json new file mode 100644 index 000000000..41b1fa496 --- /dev/null +++ b/wot-codegen/test/test-cases/success/ThingPropertyGroupsMulti.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/ThingPropertyGroupsMulti.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/test-cases/success/ThingPropertyGroupsSingle.json b/wot-codegen/test/test-cases/success/ThingPropertyGroupsSingle.json new file mode 100644 index 000000000..eff19585d --- /dev/null +++ b/wot-codegen/test/test-cases/success/ThingPropertyGroupsSingle.json @@ -0,0 +1,7 @@ +{ + "success": true, + "commandLine": { + "things": [ "valid/ThingPropertyGroupsSingle.TM.json" ], + "lang": "none" + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ActionActionConfigurationWrongType.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ActionActionConfigurationWrongType.TM.json new file mode 100644 index 000000000..4009a5387 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ActionActionConfigurationWrongType.TM.json @@ -0,0 +1,24 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "actions": { + "noop": { + "dov:actionConfiguration": "not-an-object", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + }, + "properties": { + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ActionEventConfigurationMismatch.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ActionEventConfigurationMismatch.TM.json new file mode 100644 index 000000000..cbcaf4d62 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ActionEventConfigurationMismatch.TM.json @@ -0,0 +1,26 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "actions": { + "noop": { + "dov:eventConfiguration": { + "severity": "warning" + }, + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + }, + "properties": { + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ActionMemberOfMatchesEventGroup.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ActionMemberOfMatchesEventGroup.TM.json new file mode 100644 index 000000000..921b1940d --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ActionMemberOfMatchesEventGroup.TM.json @@ -0,0 +1,23 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:eventGroups": [ + { "title": "MisplacedGroup" } + ], + "actions": { + "noop": { + "dov:memberOf": "MisplacedGroup", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ActionMemberOfMatchesPropertyGroup.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ActionMemberOfMatchesPropertyGroup.TM.json new file mode 100644 index 000000000..7fcf0b3ff --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ActionMemberOfMatchesPropertyGroup.TM.json @@ -0,0 +1,23 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:propertyGroups": [ + { "title": "MisplacedGroup" } + ], + "actions": { + "noop": { + "dov:memberOf": "MisplacedGroup", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ActionMemberOfUnknownGroup.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ActionMemberOfUnknownGroup.TM.json new file mode 100644 index 000000000..18675d588 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ActionMemberOfUnknownGroup.TM.json @@ -0,0 +1,23 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:actionGroups": [ + { "title": "SomeOtherGroup" } + ], + "actions": { + "noop": { + "dov:memberOf": "UnknownGroup", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ActionPropertyConfigurationMismatch.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ActionPropertyConfigurationMismatch.TM.json new file mode 100644 index 000000000..958b71628 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ActionPropertyConfigurationMismatch.TM.json @@ -0,0 +1,26 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "actions": { + "noop": { + "dov:propertyConfiguration": { + "category": "diagnostic" + }, + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + }, + "properties": { + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ActionPropertyIriEmpty.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ActionPropertyIriEmpty.TM.json new file mode 100644 index 000000000..9a6ebbf39 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ActionPropertyIriEmpty.TM.json @@ -0,0 +1,24 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "actions": { + "noop": { + "dov:propertyIRI": "", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + }, + "properties": { + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/EventActionConfigurationMismatch.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/EventActionConfigurationMismatch.TM.json new file mode 100644 index 000000000..87c72f6b6 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/EventActionConfigurationMismatch.TM.json @@ -0,0 +1,29 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "actions": { + }, + "properties": { + }, + "events": { + "alpha": { + "data": { + "type": "string" + }, + "dov:actionConfiguration": { + "priority": "high" + }, + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{senderId}", + "op": "subscribeevent" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/EventEventConfigurationWrongType.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/EventEventConfigurationWrongType.TM.json new file mode 100644 index 000000000..8ce608cc2 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/EventEventConfigurationWrongType.TM.json @@ -0,0 +1,27 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "actions": { + }, + "properties": { + }, + "events": { + "alpha": { + "data": { + "type": "string" + }, + "dov:eventConfiguration": "not-an-object", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{senderId}", + "op": "subscribeevent" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/EventMemberOfMatchesActionGroup.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/EventMemberOfMatchesActionGroup.TM.json new file mode 100644 index 000000000..4e9a310e7 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/EventMemberOfMatchesActionGroup.TM.json @@ -0,0 +1,30 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:actionGroups": [ + { "title": "MisplacedGroup" } + ], + "actions": { + }, + "properties": { + }, + "events": { + "alpha": { + "data": { + "type": "string" + }, + "dov:memberOf": "MisplacedGroup", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{senderId}", + "op": "subscribeevent" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/EventMemberOfMatchesPropertyGroup.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/EventMemberOfMatchesPropertyGroup.TM.json new file mode 100644 index 000000000..b42706bab --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/EventMemberOfMatchesPropertyGroup.TM.json @@ -0,0 +1,30 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:propertyGroups": [ + { "title": "MisplacedGroup" } + ], + "actions": { + }, + "properties": { + }, + "events": { + "alpha": { + "data": { + "type": "string" + }, + "dov:memberOf": "MisplacedGroup", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{senderId}", + "op": "subscribeevent" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/EventMemberOfUnknownGroup.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/EventMemberOfUnknownGroup.TM.json new file mode 100644 index 000000000..e745aabec --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/EventMemberOfUnknownGroup.TM.json @@ -0,0 +1,30 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:eventGroups": [ + { "title": "SomeOtherGroup" } + ], + "actions": { + }, + "properties": { + }, + "events": { + "alpha": { + "data": { + "type": "string" + }, + "dov:memberOf": "UnknownGroup", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{senderId}", + "op": "subscribeevent" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/EventPropertyConfigurationMismatch.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/EventPropertyConfigurationMismatch.TM.json new file mode 100644 index 000000000..80d64d53c --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/EventPropertyConfigurationMismatch.TM.json @@ -0,0 +1,29 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "actions": { + }, + "properties": { + }, + "events": { + "alpha": { + "data": { + "type": "string" + }, + "dov:propertyConfiguration": { + "category": "diagnostic" + }, + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{senderId}", + "op": "subscribeevent" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/EventPropertyIriEmpty.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/EventPropertyIriEmpty.TM.json new file mode 100644 index 000000000..b1d08575c --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/EventPropertyIriEmpty.TM.json @@ -0,0 +1,27 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "actions": { + }, + "properties": { + }, + "events": { + "alpha": { + "data": { + "type": "string" + }, + "dov:propertyIRI": "", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{senderId}", + "op": "subscribeevent" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/OptionalActionNotFound.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/OptionalActionNotFound.TM.json new file mode 100644 index 000000000..e46726992 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/OptionalActionNotFound.TM.json @@ -0,0 +1,26 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "tm:optional": [ + "/actions/missing" + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + }, + "properties": { + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/OptionalEmpty.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/OptionalEmpty.TM.json new file mode 100644 index 000000000..1873f0bcd --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/OptionalEmpty.TM.json @@ -0,0 +1,26 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "tm:optional": [ + "" + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + }, + "properties": { + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/OptionalEventNotFound.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/OptionalEventNotFound.TM.json new file mode 100644 index 000000000..365b6a486 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/OptionalEventNotFound.TM.json @@ -0,0 +1,29 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "tm:optional": [ + "/events/missing" + ], + "actions": { + }, + "properties": { + }, + "events": { + "alpha": { + "data": { + "type": "string" + }, + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{senderId}", + "op": "subscribeevent" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/OptionalInvalidFirstSegment.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/OptionalInvalidFirstSegment.TM.json new file mode 100644 index 000000000..21f682e05 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/OptionalInvalidFirstSegment.TM.json @@ -0,0 +1,26 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "tm:optional": [ + "/forms/foo" + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + }, + "properties": { + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/OptionalJsonPointerTooShort.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/OptionalJsonPointerTooShort.TM.json new file mode 100644 index 000000000..5f1f0d99c --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/OptionalJsonPointerTooShort.TM.json @@ -0,0 +1,26 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "tm:optional": [ + "/actions" + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + }, + "properties": { + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/OptionalNoActionsCollection.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/OptionalNoActionsCollection.TM.json new file mode 100644 index 000000000..e80492887 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/OptionalNoActionsCollection.TM.json @@ -0,0 +1,25 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "tm:optional": [ + "/actions/noop" + ], + "properties": { + "alpha": { + "type": "string", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{maintainerId}", + "op": "readproperty" + } + ] + } + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/OptionalNoEventsCollection.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/OptionalNoEventsCollection.TM.json new file mode 100644 index 000000000..69dec6ac9 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/OptionalNoEventsCollection.TM.json @@ -0,0 +1,24 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "tm:optional": [ + "/events/alpha" + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + }, + "properties": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/OptionalNoPropertiesCollection.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/OptionalNoPropertiesCollection.TM.json new file mode 100644 index 000000000..1c8f7623a --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/OptionalNoPropertiesCollection.TM.json @@ -0,0 +1,24 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "tm:optional": [ + "/properties/alpha" + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/OptionalPropertyNotFound.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/OptionalPropertyNotFound.TM.json new file mode 100644 index 000000000..bde037ac8 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/OptionalPropertyNotFound.TM.json @@ -0,0 +1,27 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "tm:optional": [ + "/properties/missing" + ], + "actions": { + }, + "properties": { + "alpha": { + "type": "string", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{maintainerId}", + "op": "readproperty" + } + ] + } + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/PropertyActionConfigurationMismatch.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/PropertyActionConfigurationMismatch.TM.json new file mode 100644 index 000000000..afb50aee0 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/PropertyActionConfigurationMismatch.TM.json @@ -0,0 +1,27 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "actions": { + }, + "properties": { + "alpha": { + "type": "string", + "dov:actionConfiguration": { + "priority": "high" + }, + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{maintainerId}", + "op": "readproperty" + } + ] + } + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/PropertyEventConfigurationMismatch.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/PropertyEventConfigurationMismatch.TM.json new file mode 100644 index 000000000..16446a61d --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/PropertyEventConfigurationMismatch.TM.json @@ -0,0 +1,27 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "actions": { + }, + "properties": { + "alpha": { + "type": "string", + "dov:eventConfiguration": { + "severity": "warning" + }, + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{maintainerId}", + "op": "readproperty" + } + ] + } + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/PropertyMemberOfMatchesActionGroup.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/PropertyMemberOfMatchesActionGroup.TM.json new file mode 100644 index 000000000..0d9e50302 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/PropertyMemberOfMatchesActionGroup.TM.json @@ -0,0 +1,28 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:actionGroups": [ + { "title": "MisplacedGroup" } + ], + "actions": { + }, + "properties": { + "alpha": { + "type": "string", + "dov:memberOf": "MisplacedGroup", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{maintainerId}", + "op": "readproperty" + } + ] + } + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/PropertyMemberOfMatchesEventGroup.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/PropertyMemberOfMatchesEventGroup.TM.json new file mode 100644 index 000000000..4a0301bac --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/PropertyMemberOfMatchesEventGroup.TM.json @@ -0,0 +1,28 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:eventGroups": [ + { "title": "MisplacedGroup" } + ], + "actions": { + }, + "properties": { + "alpha": { + "type": "string", + "dov:memberOf": "MisplacedGroup", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{maintainerId}", + "op": "readproperty" + } + ] + } + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/PropertyMemberOfUnknownGroup.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/PropertyMemberOfUnknownGroup.TM.json new file mode 100644 index 000000000..b41a93b7c --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/PropertyMemberOfUnknownGroup.TM.json @@ -0,0 +1,28 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:propertyGroups": [ + { "title": "SomeOtherGroup" } + ], + "actions": { + }, + "properties": { + "alpha": { + "type": "string", + "dov:memberOf": "UnknownGroup", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{maintainerId}", + "op": "readproperty" + } + ] + } + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/PropertyPropertyConfigurationWrongType.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/PropertyPropertyConfigurationWrongType.TM.json new file mode 100644 index 000000000..04542d513 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/PropertyPropertyConfigurationWrongType.TM.json @@ -0,0 +1,25 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "actions": { + }, + "properties": { + "alpha": { + "type": "string", + "dov:propertyConfiguration": "not-an-object", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{maintainerId}", + "op": "readproperty" + } + ] + } + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/PropertyPropertyIriEmpty.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/PropertyPropertyIriEmpty.TM.json new file mode 100644 index 000000000..aafc33130 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/PropertyPropertyIriEmpty.TM.json @@ -0,0 +1,25 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "actions": { + }, + "properties": { + "alpha": { + "type": "string", + "dov:propertyIRI": "", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{maintainerId}", + "op": "readproperty" + } + ] + } + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsDuplicateTitle.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsDuplicateTitle.TM.json new file mode 100644 index 000000000..983deb96b --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsDuplicateTitle.TM.json @@ -0,0 +1,29 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:actionGroups": [ + { + "title": "GroupOne", + "priority": 1 + }, + { + "title": "GroupOne", + "priority": 2 + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsMissingTitle.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsMissingTitle.TM.json new file mode 100644 index 000000000..dd5fd94cb --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsMissingTitle.TM.json @@ -0,0 +1,25 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:actionGroups": [ + { + "description": "missing title", + "priority": 1 + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsTitleEmpty.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsTitleEmpty.TM.json new file mode 100644 index 000000000..29593bd73 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsTitleEmpty.TM.json @@ -0,0 +1,25 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:actionGroups": [ + { + "title": "", + "description": "empty title" + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsTitleWrongType.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsTitleWrongType.TM.json new file mode 100644 index 000000000..d08b39897 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsTitleWrongType.TM.json @@ -0,0 +1,25 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:actionGroups": [ + { + "title": 42, + "description": "non-string title" + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsWrongType.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsWrongType.TM.json new file mode 100644 index 000000000..7aef4ee14 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsWrongType.TM.json @@ -0,0 +1,22 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:actionGroups": [ + "not-an-object" + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ThingEventActionGroupsDuplicateTitle.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ThingEventActionGroupsDuplicateTitle.TM.json new file mode 100644 index 000000000..061d42e5e --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ThingEventActionGroupsDuplicateTitle.TM.json @@ -0,0 +1,31 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:eventGroups": [ + { + "title": "SharedGroup", + "priority": 1 + } + ], + "dov:actionGroups": [ + { + "title": "SharedGroup", + "priority": 2 + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsDuplicateTitle.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsDuplicateTitle.TM.json new file mode 100644 index 000000000..7a63104ea --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsDuplicateTitle.TM.json @@ -0,0 +1,29 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:eventGroups": [ + { + "title": "GroupOne", + "priority": 1 + }, + { + "title": "GroupOne", + "priority": 2 + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsMissingTitle.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsMissingTitle.TM.json new file mode 100644 index 000000000..e4883ae12 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsMissingTitle.TM.json @@ -0,0 +1,25 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:eventGroups": [ + { + "description": "missing title", + "priority": 1 + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsTitleEmpty.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsTitleEmpty.TM.json new file mode 100644 index 000000000..667830fdf --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsTitleEmpty.TM.json @@ -0,0 +1,25 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:eventGroups": [ + { + "title": "", + "description": "empty title" + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsTitleWrongType.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsTitleWrongType.TM.json new file mode 100644 index 000000000..2de5aa3e8 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsTitleWrongType.TM.json @@ -0,0 +1,25 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:eventGroups": [ + { + "title": 42, + "description": "non-string title" + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsWrongType.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsWrongType.TM.json new file mode 100644 index 000000000..458d34e90 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsWrongType.TM.json @@ -0,0 +1,22 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:eventGroups": [ + "not-an-object" + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ThingMetadataWrongType.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ThingMetadataWrongType.TM.json new file mode 100644 index 000000000..311a02733 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ThingMetadataWrongType.TM.json @@ -0,0 +1,24 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:metadata": "not-an-object", + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + }, + "properties": { + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyActionGroupsDuplicateTitle.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyActionGroupsDuplicateTitle.TM.json new file mode 100644 index 000000000..9ad62a4a7 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyActionGroupsDuplicateTitle.TM.json @@ -0,0 +1,31 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:propertyGroups": [ + { + "title": "SharedGroup", + "priority": 1 + } + ], + "dov:actionGroups": [ + { + "title": "SharedGroup", + "priority": 2 + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyEventGroupsDuplicateTitle.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyEventGroupsDuplicateTitle.TM.json new file mode 100644 index 000000000..1f34251a7 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyEventGroupsDuplicateTitle.TM.json @@ -0,0 +1,31 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:propertyGroups": [ + { + "title": "SharedGroup", + "priority": 1 + } + ], + "dov:eventGroups": [ + { + "title": "SharedGroup", + "priority": 2 + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsDuplicateTitle.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsDuplicateTitle.TM.json new file mode 100644 index 000000000..f65773694 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsDuplicateTitle.TM.json @@ -0,0 +1,29 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:propertyGroups": [ + { + "title": "GroupOne", + "priority": 1 + }, + { + "title": "GroupOne", + "priority": 2 + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsMissingTitle.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsMissingTitle.TM.json new file mode 100644 index 000000000..e1c7399c8 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsMissingTitle.TM.json @@ -0,0 +1,25 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:propertyGroups": [ + { + "description": "missing title", + "priority": 1 + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsTitleEmpty.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsTitleEmpty.TM.json new file mode 100644 index 000000000..4162a9741 --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsTitleEmpty.TM.json @@ -0,0 +1,25 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:propertyGroups": [ + { + "title": "", + "description": "empty title" + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsTitleWrongType.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsTitleWrongType.TM.json new file mode 100644 index 000000000..1138e6c7e --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsTitleWrongType.TM.json @@ -0,0 +1,25 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:propertyGroups": [ + { + "title": 42, + "description": "non-string title" + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsWrongType.TM.json b/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsWrongType.TM.json new file mode 100644 index 000000000..3ee1f997e --- /dev/null +++ b/wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsWrongType.TM.json @@ -0,0 +1,22 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:propertyGroups": [ + "not-an-object" + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/valid/ActionActionConfiguration.TM.json b/wot-codegen/test/thing-models/valid/ActionActionConfiguration.TM.json new file mode 100644 index 000000000..88ce667e3 --- /dev/null +++ b/wot-codegen/test/thing-models/valid/ActionActionConfiguration.TM.json @@ -0,0 +1,28 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "actions": { + "noop": { + "dov:actionConfiguration": { + "priority": "high", + "retryCount": 3, + "useCache": true + }, + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + }, + "properties": { + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/valid/ActionMemberOfMatchesGroup.TM.json b/wot-codegen/test/thing-models/valid/ActionMemberOfMatchesGroup.TM.json new file mode 100644 index 000000000..87c689b9a --- /dev/null +++ b/wot-codegen/test/thing-models/valid/ActionMemberOfMatchesGroup.TM.json @@ -0,0 +1,23 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:actionGroups": [ + { "title": "MyActionGroup" } + ], + "actions": { + "noop": { + "dov:memberOf": "MyActionGroup", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/valid/ActionPropertyIri.TM.json b/wot-codegen/test/thing-models/valid/ActionPropertyIri.TM.json new file mode 100644 index 000000000..c681e747f --- /dev/null +++ b/wot-codegen/test/thing-models/valid/ActionPropertyIri.TM.json @@ -0,0 +1,24 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "actions": { + "noop": { + "dov:propertyIRI": "http://example.com/iri/noop", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + }, + "properties": { + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/valid/EventEventConfiguration.TM.json b/wot-codegen/test/thing-models/valid/EventEventConfiguration.TM.json new file mode 100644 index 000000000..afbed083f --- /dev/null +++ b/wot-codegen/test/thing-models/valid/EventEventConfiguration.TM.json @@ -0,0 +1,31 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "actions": { + }, + "properties": { + }, + "events": { + "alpha": { + "data": { + "type": "string" + }, + "dov:eventConfiguration": { + "severity": "warning", + "throttleMs": 500, + "enabled": true + }, + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{senderId}", + "op": "subscribeevent" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/EventMemberOf.TM.json b/wot-codegen/test/thing-models/valid/EventMemberOf.TM.json similarity index 89% rename from wot-codegen/test/thing-models/invalidAioBinding/EventMemberOf.TM.json rename to wot-codegen/test/thing-models/valid/EventMemberOf.TM.json index 45548fe1f..b220eea4b 100644 --- a/wot-codegen/test/thing-models/invalidAioBinding/EventMemberOf.TM.json +++ b/wot-codegen/test/thing-models/valid/EventMemberOf.TM.json @@ -5,6 +5,9 @@ ], "@type": "tm:ThingModel", "title": "Noop", + "dov:eventGroups": [ + { "title": "MyPropertyGroup" } + ], "actions": { }, "properties": { diff --git a/wot-codegen/test/thing-models/valid/EventMemberOfMatchesGroup.TM.json b/wot-codegen/test/thing-models/valid/EventMemberOfMatchesGroup.TM.json new file mode 100644 index 000000000..ed3db8cbe --- /dev/null +++ b/wot-codegen/test/thing-models/valid/EventMemberOfMatchesGroup.TM.json @@ -0,0 +1,30 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:eventGroups": [ + { "title": "MyEventGroup" } + ], + "actions": { + }, + "properties": { + }, + "events": { + "alpha": { + "data": { + "type": "string" + }, + "dov:memberOf": "MyEventGroup", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{senderId}", + "op": "subscribeevent" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/valid/EventPropertyIri.TM.json b/wot-codegen/test/thing-models/valid/EventPropertyIri.TM.json new file mode 100644 index 000000000..5722fc98c --- /dev/null +++ b/wot-codegen/test/thing-models/valid/EventPropertyIri.TM.json @@ -0,0 +1,27 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "actions": { + }, + "properties": { + }, + "events": { + "alpha": { + "data": { + "type": "string" + }, + "dov:propertyIRI": "http://example.com/iri/alpha", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{senderId}", + "op": "subscribeevent" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/valid/OptionalAction.TM.json b/wot-codegen/test/thing-models/valid/OptionalAction.TM.json new file mode 100644 index 000000000..60a06293e --- /dev/null +++ b/wot-codegen/test/thing-models/valid/OptionalAction.TM.json @@ -0,0 +1,26 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "tm:optional": [ + "/actions/noop" + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + }, + "properties": { + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/valid/OptionalEvent.TM.json b/wot-codegen/test/thing-models/valid/OptionalEvent.TM.json new file mode 100644 index 000000000..24f2a736e --- /dev/null +++ b/wot-codegen/test/thing-models/valid/OptionalEvent.TM.json @@ -0,0 +1,29 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "tm:optional": [ + "/events/alpha" + ], + "actions": { + }, + "properties": { + }, + "events": { + "alpha": { + "data": { + "type": "string" + }, + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{senderId}", + "op": "subscribeevent" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/valid/OptionalProperty.TM.json b/wot-codegen/test/thing-models/valid/OptionalProperty.TM.json new file mode 100644 index 000000000..3df7d8f2f --- /dev/null +++ b/wot-codegen/test/thing-models/valid/OptionalProperty.TM.json @@ -0,0 +1,27 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "tm:optional": [ + "/properties/alpha" + ], + "actions": { + }, + "properties": { + "alpha": { + "type": "string", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{maintainerId}", + "op": "readproperty" + } + ] + } + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/invalidAioBinding/PropertyMemberOf.TM.json b/wot-codegen/test/thing-models/valid/PropertyMemberOf.TM.json similarity index 88% rename from wot-codegen/test/thing-models/invalidAioBinding/PropertyMemberOf.TM.json rename to wot-codegen/test/thing-models/valid/PropertyMemberOf.TM.json index 03eeb920f..02bedc7a2 100644 --- a/wot-codegen/test/thing-models/invalidAioBinding/PropertyMemberOf.TM.json +++ b/wot-codegen/test/thing-models/valid/PropertyMemberOf.TM.json @@ -5,6 +5,9 @@ ], "@type": "tm:ThingModel", "title": "Noop", + "dov:propertyGroups": [ + { "title": "MyPropertyGroup" } + ], "actions": { }, "properties": { diff --git a/wot-codegen/test/thing-models/valid/PropertyMemberOfMatchesGroup.TM.json b/wot-codegen/test/thing-models/valid/PropertyMemberOfMatchesGroup.TM.json new file mode 100644 index 000000000..02bedc7a2 --- /dev/null +++ b/wot-codegen/test/thing-models/valid/PropertyMemberOfMatchesGroup.TM.json @@ -0,0 +1,28 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:propertyGroups": [ + { "title": "MyPropertyGroup" } + ], + "actions": { + }, + "properties": { + "alpha": { + "type": "string", + "dov:memberOf": "MyPropertyGroup", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{maintainerId}", + "op": "readproperty" + } + ] + } + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/valid/PropertyPropertyConfiguration.TM.json b/wot-codegen/test/thing-models/valid/PropertyPropertyConfiguration.TM.json new file mode 100644 index 000000000..2555cc197 --- /dev/null +++ b/wot-codegen/test/thing-models/valid/PropertyPropertyConfiguration.TM.json @@ -0,0 +1,29 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "actions": { + }, + "properties": { + "alpha": { + "type": "string", + "dov:propertyConfiguration": { + "category": "diagnostic", + "samplingRateMs": 1000, + "persistent": false + }, + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{maintainerId}", + "op": "readproperty" + } + ] + } + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/valid/PropertyPropertyIri.TM.json b/wot-codegen/test/thing-models/valid/PropertyPropertyIri.TM.json new file mode 100644 index 000000000..54072bc39 --- /dev/null +++ b/wot-codegen/test/thing-models/valid/PropertyPropertyIri.TM.json @@ -0,0 +1,25 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "actions": { + }, + "properties": { + "alpha": { + "type": "string", + "dov:propertyIRI": "http://example.com/iri/alpha", + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/alpha/{maintainerId}", + "op": "readproperty" + } + ] + } + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/valid/ThingActionGroupsMulti.TM.json b/wot-codegen/test/thing-models/valid/ThingActionGroupsMulti.TM.json new file mode 100644 index 000000000..f7e1e75f5 --- /dev/null +++ b/wot-codegen/test/thing-models/valid/ThingActionGroupsMulti.TM.json @@ -0,0 +1,35 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:actionGroups": [ + { + "title": "GroupOne", + "description": "First action group", + "priority": 1 + }, + { + "title": "GroupTwo", + "description": "Second action group", + "priority": 2 + }, + { + "title": "GroupThree", + "tags": [ "alpha", "beta" ] + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/valid/ThingActionGroupsSingle.TM.json b/wot-codegen/test/thing-models/valid/ThingActionGroupsSingle.TM.json new file mode 100644 index 000000000..08d51f75e --- /dev/null +++ b/wot-codegen/test/thing-models/valid/ThingActionGroupsSingle.TM.json @@ -0,0 +1,26 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:actionGroups": [ + { + "title": "GroupOne", + "description": "First group", + "priority": 1 + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/valid/ThingEventGroupsMulti.TM.json b/wot-codegen/test/thing-models/valid/ThingEventGroupsMulti.TM.json new file mode 100644 index 000000000..955c0e550 --- /dev/null +++ b/wot-codegen/test/thing-models/valid/ThingEventGroupsMulti.TM.json @@ -0,0 +1,35 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:eventGroups": [ + { + "title": "GroupOne", + "description": "First event group", + "priority": 1 + }, + { + "title": "GroupTwo", + "description": "Second event group", + "priority": 2 + }, + { + "title": "GroupThree", + "tags": [ "alpha", "beta" ] + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/valid/ThingEventGroupsSingle.TM.json b/wot-codegen/test/thing-models/valid/ThingEventGroupsSingle.TM.json new file mode 100644 index 000000000..9424acde8 --- /dev/null +++ b/wot-codegen/test/thing-models/valid/ThingEventGroupsSingle.TM.json @@ -0,0 +1,26 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:eventGroups": [ + { + "title": "GroupOne", + "description": "First group", + "priority": 1 + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/valid/ThingMetadata.TM.json b/wot-codegen/test/thing-models/valid/ThingMetadata.TM.json new file mode 100644 index 000000000..6cfce7e31 --- /dev/null +++ b/wot-codegen/test/thing-models/valid/ThingMetadata.TM.json @@ -0,0 +1,28 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:metadata": { + "version": "1.2.3", + "author": "Contoso", + "deprecated": false + }, + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + }, + "properties": { + }, + "events": { + } +} diff --git a/wot-codegen/test/thing-models/valid/ThingPropertyGroupsMulti.TM.json b/wot-codegen/test/thing-models/valid/ThingPropertyGroupsMulti.TM.json new file mode 100644 index 000000000..7beb49f36 --- /dev/null +++ b/wot-codegen/test/thing-models/valid/ThingPropertyGroupsMulti.TM.json @@ -0,0 +1,35 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:propertyGroups": [ + { + "title": "GroupOne", + "description": "First property group", + "priority": 1 + }, + { + "title": "GroupTwo", + "description": "Second property group", + "priority": 2 + }, + { + "title": "GroupThree", + "tags": [ "alpha", "beta" ] + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +} diff --git a/wot-codegen/test/thing-models/valid/ThingPropertyGroupsSingle.TM.json b/wot-codegen/test/thing-models/valid/ThingPropertyGroupsSingle.TM.json new file mode 100644 index 000000000..6ccd37c10 --- /dev/null +++ b/wot-codegen/test/thing-models/valid/ThingPropertyGroupsSingle.TM.json @@ -0,0 +1,26 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "dov": "http://azure.com/DigitalOperations/vocab#" } + ], + "@type": "tm:ThingModel", + "title": "Noop", + "dov:propertyGroups": [ + { + "title": "GroupOne", + "description": "First group", + "priority": 1 + } + ], + "actions": { + "noop": { + "forms": [ + { + "contentType": "application/json", + "dov:topic": "sample/TestThing/command/noop", + "op": "invokeaction" + } + ] + } + } +}