Add new properties, types, and validation rules to C# ThingValidator#1340
Open
jrdouceur wants to merge 3 commits into
Open
Add new properties, types, and validation rules to C# ThingValidator#1340jrdouceur wants to merge 3 commits into
jrdouceur wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the WoT codegen C# Thing Model parsing/validation pipeline to recognize additional Digital Operations Vocabulary (DoV) extensions (metadata, affordance groups, member-of grouping, and property IRI/config objects) and adds a broad set of new valid/invalid fixture Thing Models plus expected test outcomes to exercise these rules.
Changes:
- Added new TDParser model types/properties for
dov:metadata,dov:*Groups,dov:memberOf,dov:propertyIRI, anddov:*Configuration. - Expanded
ThingValidatorto validate affordance group structure/uniqueness and enforcememberOfreferences against the correct group arrays, plus basicpropertyIRIvalidation. - Added many new success/failure test fixtures and expected results for the new validation behaviors.
Reviewed changes
Copilot reviewed 124 out of 124 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDThing.cs | Adds Thing-level support for dov:metadata and affordance group arrays. |
| wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDProperty.cs | Adds property-level support for dov:memberOf, dov:propertyIRI, and dov:propertyConfiguration. |
| wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDEvent.cs | Adds event-level support for dov:memberOf, dov:propertyIRI, and dov:eventConfiguration. |
| wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDAction.cs | Adds action-level support for dov:propertyIRI and dov:actionConfiguration; centralizes memberOf constants via TDCommon. |
| wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDCommon.cs | Introduces shared constants for dov:memberOf and dov:propertyIRI (plus legacy memberOf). |
| wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDAnything.cs | New “accept any object” model used for metadata/config blocks. |
| wot-codegen/src/Azure.Iot.Operations.TDParser/Model/TDAffordanceGroup.cs | New affordance-group model for parsing group entries (currently title-focused). |
| wot-codegen/src/Azure.Iot.Operations.CodeGeneration/ThingValidator.cs | Adds affordance-group validation, memberOf → group resolution, and propertyIRI validation; wires group arrays through action/property/event validation. |
| wot-codegen/test/thing-models/valid/ThingPropertyGroupsSingle.TM.json | New valid fixture for a single property group. |
| wot-codegen/test/thing-models/valid/ThingPropertyGroupsMulti.TM.json | New valid fixture for multiple property groups. |
| wot-codegen/test/thing-models/valid/ThingMetadata.TM.json | New valid fixture for dov:metadata. |
| wot-codegen/test/thing-models/valid/ThingEventGroupsSingle.TM.json | New valid fixture for a single event group. |
| wot-codegen/test/thing-models/valid/ThingEventGroupsMulti.TM.json | New valid fixture for multiple event groups. |
| wot-codegen/test/thing-models/valid/ThingActionGroupsSingle.TM.json | New valid fixture for a single action group. |
| wot-codegen/test/thing-models/valid/ThingActionGroupsMulti.TM.json | New valid fixture for multiple action groups. |
| wot-codegen/test/thing-models/valid/PropertyPropertyIri.TM.json | New valid fixture for property dov:propertyIRI. |
| wot-codegen/test/thing-models/valid/PropertyPropertyConfiguration.TM.json | New valid fixture for property dov:propertyConfiguration. |
| wot-codegen/test/thing-models/valid/PropertyMemberOfMatchesGroup.TM.json | New valid fixture where property dov:memberOf matches a property group title. |
| wot-codegen/test/thing-models/valid/PropertyMemberOf.TM.json | Updates existing valid fixture to include dov:propertyGroups needed for memberOf. |
| wot-codegen/test/thing-models/valid/EventPropertyIri.TM.json | New valid fixture for event dov:propertyIRI. |
| wot-codegen/test/thing-models/valid/EventMemberOfMatchesGroup.TM.json | New valid fixture where event dov:memberOf matches an event group title. |
| wot-codegen/test/thing-models/valid/EventMemberOf.TM.json | Updates existing valid fixture to include dov:eventGroups needed for memberOf. |
| wot-codegen/test/thing-models/valid/EventEventConfiguration.TM.json | New valid fixture for event dov:eventConfiguration. |
| wot-codegen/test/thing-models/valid/ActionPropertyIri.TM.json | New valid fixture for action dov:propertyIRI. |
| wot-codegen/test/thing-models/valid/ActionMemberOfMatchesGroup.TM.json | New valid fixture where action dov:memberOf matches an action group title. |
| wot-codegen/test/thing-models/valid/ActionActionConfiguration.TM.json | New valid fixture for action dov:actionConfiguration. |
| wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsWrongType.TM.json | New invalid fixture: propertyGroups contains a non-object element. |
| wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsTitleWrongType.TM.json | New invalid fixture: property group title has wrong type. |
| wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsTitleEmpty.TM.json | New invalid fixture: property group title is empty. |
| wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsMissingTitle.TM.json | New invalid fixture: property group missing title. |
| wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyGroupsDuplicateTitle.TM.json | New invalid fixture: duplicate titles within propertyGroups. |
| wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyEventGroupsDuplicateTitle.TM.json | New invalid fixture: duplicate titles across propertyGroups/eventGroups. |
| wot-codegen/test/thing-models/invalidAioBinding/ThingPropertyActionGroupsDuplicateTitle.TM.json | New invalid fixture: duplicate titles across propertyGroups/actionGroups. |
| wot-codegen/test/thing-models/invalidAioBinding/ThingMetadataWrongType.TM.json | New invalid fixture: metadata is not an object. |
| wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsWrongType.TM.json | New invalid fixture: eventGroups contains a non-object element. |
| wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsTitleWrongType.TM.json | New invalid fixture: event group title has wrong type. |
| wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsTitleEmpty.TM.json | New invalid fixture: event group title is empty. |
| wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsMissingTitle.TM.json | New invalid fixture: event group missing title. |
| wot-codegen/test/thing-models/invalidAioBinding/ThingEventGroupsDuplicateTitle.TM.json | New invalid fixture: duplicate titles within eventGroups. |
| wot-codegen/test/thing-models/invalidAioBinding/ThingEventActionGroupsDuplicateTitle.TM.json | New invalid fixture: duplicate titles across eventGroups/actionGroups. |
| wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsWrongType.TM.json | New invalid fixture: actionGroups contains a non-object element. |
| wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsTitleWrongType.TM.json | New invalid fixture: action group title has wrong type. |
| wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsTitleEmpty.TM.json | New invalid fixture: action group title is empty. |
| wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsMissingTitle.TM.json | New invalid fixture: action group missing title. |
| wot-codegen/test/thing-models/invalidAioBinding/ThingActionGroupsDuplicateTitle.TM.json | New invalid fixture: duplicate titles within actionGroups. |
| wot-codegen/test/thing-models/invalidAioBinding/PropertyPropertyIriEmpty.TM.json | New invalid fixture: propertyIRI is empty. |
| wot-codegen/test/thing-models/invalidAioBinding/PropertyPropertyConfigurationWrongType.TM.json | New invalid fixture: propertyConfiguration is not an object. |
| wot-codegen/test/thing-models/invalidAioBinding/PropertyMemberOfUnknownGroup.TM.json | New invalid fixture: property memberOf references unknown property group. |
| wot-codegen/test/thing-models/invalidAioBinding/PropertyMemberOfMatchesEventGroup.TM.json | New invalid fixture: property memberOf matches event group (wrong group namespace). |
| wot-codegen/test/thing-models/invalidAioBinding/PropertyMemberOfMatchesActionGroup.TM.json | New invalid fixture: property memberOf matches action group (wrong group namespace). |
| wot-codegen/test/thing-models/invalidAioBinding/PropertyEventConfigurationMismatch.TM.json | New invalid fixture: property uses eventConfiguration (unsupported on property). |
| wot-codegen/test/thing-models/invalidAioBinding/PropertyActionConfigurationMismatch.TM.json | New invalid fixture: property uses actionConfiguration (unsupported on property). |
| wot-codegen/test/thing-models/invalidAioBinding/EventPropertyIriEmpty.TM.json | New invalid fixture: event propertyIRI is empty. |
| wot-codegen/test/thing-models/invalidAioBinding/EventPropertyConfigurationMismatch.TM.json | New invalid fixture: event uses propertyConfiguration (unsupported on event). |
| wot-codegen/test/thing-models/invalidAioBinding/EventMemberOfUnknownGroup.TM.json | New invalid fixture: event memberOf references unknown event group. |
| wot-codegen/test/thing-models/invalidAioBinding/EventMemberOfMatchesPropertyGroup.TM.json | New invalid fixture: event memberOf matches property group (wrong group namespace). |
| wot-codegen/test/thing-models/invalidAioBinding/EventMemberOfMatchesActionGroup.TM.json | New invalid fixture: event memberOf matches action group (wrong group namespace). |
| wot-codegen/test/thing-models/invalidAioBinding/EventEventConfigurationWrongType.TM.json | New invalid fixture: eventConfiguration is not an object. |
| wot-codegen/test/thing-models/invalidAioBinding/EventActionConfigurationMismatch.TM.json | New invalid fixture: event uses actionConfiguration (unsupported on event). |
| wot-codegen/test/thing-models/invalidAioBinding/ActionPropertyIriEmpty.TM.json | New invalid fixture: action propertyIRI is empty. |
| wot-codegen/test/thing-models/invalidAioBinding/ActionPropertyConfigurationMismatch.TM.json | New invalid fixture: action uses propertyConfiguration (unsupported on action). |
| wot-codegen/test/thing-models/invalidAioBinding/ActionMemberOfUnknownGroup.TM.json | New invalid fixture: action memberOf references unknown action group. |
| wot-codegen/test/thing-models/invalidAioBinding/ActionMemberOfMatchesPropertyGroup.TM.json | New invalid fixture: action memberOf matches property group (wrong group namespace). |
| wot-codegen/test/thing-models/invalidAioBinding/ActionMemberOfMatchesEventGroup.TM.json | New invalid fixture: action memberOf matches event group (wrong group namespace). |
| wot-codegen/test/thing-models/invalidAioBinding/ActionEventConfigurationMismatch.TM.json | New invalid fixture: action uses eventConfiguration (unsupported on action). |
| wot-codegen/test/thing-models/invalidAioBinding/ActionActionConfigurationWrongType.TM.json | New invalid fixture: actionConfiguration is not an object. |
| wot-codegen/test/test-cases/success/ThingPropertyGroupsSingle.json | Adds success test-case for single property group fixture. |
| wot-codegen/test/test-cases/success/ThingPropertyGroupsMulti.json | Adds success test-case for multi property group fixture. |
| wot-codegen/test/test-cases/success/ThingMetadata.json | Adds success test-case for metadata fixture. |
| wot-codegen/test/test-cases/success/ThingEventGroupsSingle.json | Adds success test-case for single event group fixture. |
| wot-codegen/test/test-cases/success/ThingEventGroupsMulti.json | Adds success test-case for multi event group fixture. |
| wot-codegen/test/test-cases/success/ThingActionGroupsSingle.json | Adds success test-case for single action group fixture. |
| wot-codegen/test/test-cases/success/ThingActionGroupsMulti.json | Adds success test-case for multi action group fixture. |
| wot-codegen/test/test-cases/success/PropertyPropertyIri.json | Adds success test-case for propertyIRI fixture. |
| wot-codegen/test/test-cases/success/PropertyPropertyConfiguration.json | Adds success test-case for propertyConfiguration fixture. |
| wot-codegen/test/test-cases/success/PropertyMemberOfMatchesGroup.json | Adds success test-case for property memberOf fixture. |
| wot-codegen/test/test-cases/success/PropertyMemberOf.json | Adds success test-case for updated PropertyMemberOf fixture. |
| wot-codegen/test/test-cases/success/EventPropertyIri.json | Adds success test-case for event propertyIRI fixture. |
| wot-codegen/test/test-cases/success/EventMemberOfMatchesGroup.json | Adds success test-case for event memberOf fixture. |
| wot-codegen/test/test-cases/success/EventMemberOf.json | Adds success test-case for updated EventMemberOf fixture. |
| wot-codegen/test/test-cases/success/EventEventConfiguration.json | Adds success test-case for eventConfiguration fixture. |
| wot-codegen/test/test-cases/success/ActionPropertyIri.json | Adds success test-case for action propertyIRI fixture. |
| wot-codegen/test/test-cases/success/ActionMemberOfMatchesGroup.json | Adds success test-case for action memberOf fixture. |
| wot-codegen/test/test-cases/success/ActionActionConfiguration.json | Adds success test-case for actionConfiguration fixture. |
| wot-codegen/test/test-cases/failure/ThingPropertyGroupsWrongType.json | Adds failure expectations for invalid propertyGroups element type. |
| wot-codegen/test/test-cases/failure/ThingPropertyGroupsTitleWrongType.json | Adds failure expectations for invalid propertyGroups title type. |
| wot-codegen/test/test-cases/failure/ThingPropertyGroupsTitleEmpty.json | Adds failure expectations for empty propertyGroups title. |
| wot-codegen/test/test-cases/failure/ThingPropertyGroupsMissingTitle.json | Adds failure expectations for missing propertyGroups title. |
| wot-codegen/test/test-cases/failure/ThingPropertyGroupsDuplicateTitle.json | Adds failure expectations for duplicate titles within propertyGroups. |
| wot-codegen/test/test-cases/failure/ThingPropertyEventGroupsDuplicateTitle.json | Adds failure expectations for duplicate titles across propertyGroups/eventGroups. |
| wot-codegen/test/test-cases/failure/ThingPropertyActionGroupsDuplicateTitle.json | Adds failure expectations for duplicate titles across propertyGroups/actionGroups. |
| wot-codegen/test/test-cases/failure/ThingMetadataWrongType.json | Adds failure expectations for metadata wrong type. |
| wot-codegen/test/test-cases/failure/ThingEventGroupsWrongType.json | Adds failure expectations for invalid eventGroups element type. |
| wot-codegen/test/test-cases/failure/ThingEventGroupsTitleWrongType.json | Adds failure expectations for invalid eventGroups title type. |
| wot-codegen/test/test-cases/failure/ThingEventGroupsTitleEmpty.json | Adds failure expectations for empty eventGroups title. |
| wot-codegen/test/test-cases/failure/ThingEventGroupsMissingTitle.json | Adds failure expectations for missing eventGroups title. |
| wot-codegen/test/test-cases/failure/ThingEventGroupsDuplicateTitle.json | Adds failure expectations for duplicate titles within eventGroups. |
| wot-codegen/test/test-cases/failure/ThingEventActionGroupsDuplicateTitle.json | Adds failure expectations for duplicate titles across eventGroups/actionGroups. |
| wot-codegen/test/test-cases/failure/ThingActionGroupsWrongType.json | Adds failure expectations for invalid actionGroups element type. |
| wot-codegen/test/test-cases/failure/ThingActionGroupsTitleWrongType.json | Adds failure expectations for invalid actionGroups title type. |
| wot-codegen/test/test-cases/failure/ThingActionGroupsTitleEmpty.json | Adds failure expectations for empty actionGroups title. |
| wot-codegen/test/test-cases/failure/ThingActionGroupsMissingTitle.json | Adds failure expectations for missing actionGroups title. |
| wot-codegen/test/test-cases/failure/ThingActionGroupsDuplicateTitle.json | Adds failure expectations for duplicate titles within actionGroups. |
| wot-codegen/test/test-cases/failure/PropertyPropertyIriEmpty.json | Adds failure expectations for empty propertyIRI on property. |
| wot-codegen/test/test-cases/failure/PropertyPropertyConfigurationWrongType.json | Adds failure expectations for propertyConfiguration wrong type. |
| wot-codegen/test/test-cases/failure/PropertyMemberOfUnknownGroup.json | Adds failure expectations for property memberOf unknown group. |
| wot-codegen/test/test-cases/failure/PropertyMemberOfMatchesEventGroup.json | Adds failure expectations for property memberOf pointing at event group. |
| wot-codegen/test/test-cases/failure/PropertyMemberOfMatchesActionGroup.json | Adds failure expectations for property memberOf pointing at action group. |
| wot-codegen/test/test-cases/failure/PropertyEventConfigurationMismatch.json | Updates failure expectations to point at the correct fixture (property using eventConfiguration). |
| wot-codegen/test/test-cases/failure/PropertyActionConfigurationMismatch.json | Adds failure expectations for property using actionConfiguration. |
| wot-codegen/test/test-cases/failure/EventPropertyIriEmpty.json | Adds failure expectations for empty propertyIRI on event. |
| wot-codegen/test/test-cases/failure/EventPropertyConfigurationMismatch.json | Adds failure expectations for event using propertyConfiguration. |
| wot-codegen/test/test-cases/failure/EventMemberOfUnknownGroup.json | Adds failure expectations for event memberOf unknown group. |
| wot-codegen/test/test-cases/failure/EventMemberOfMatchesPropertyGroup.json | Adds failure expectations for event memberOf pointing at property group. |
| wot-codegen/test/test-cases/failure/EventMemberOfMatchesActionGroup.json | Adds failure expectations for event memberOf pointing at action group. |
| wot-codegen/test/test-cases/failure/EventEventConfigurationWrongType.json | Adds failure expectations for eventConfiguration wrong type. |
| wot-codegen/test/test-cases/failure/EventActionConfigurationMismatch.json | Updates failure expectations to point at the correct fixture (event using actionConfiguration). |
| wot-codegen/test/test-cases/failure/ActionPropertyIriEmpty.json | Adds failure expectations for empty propertyIRI on action. |
| wot-codegen/test/test-cases/failure/ActionPropertyConfigurationMismatch.json | Adds failure expectations for action using propertyConfiguration. |
| wot-codegen/test/test-cases/failure/ActionMemberOfUnknownGroup.json | Adds failure expectations for action memberOf unknown group. |
| wot-codegen/test/test-cases/failure/ActionMemberOfMatchesPropertyGroup.json | Adds failure expectations for action memberOf pointing at property group. |
| wot-codegen/test/test-cases/failure/ActionMemberOfMatchesEventGroup.json | Adds failure expectations for action memberOf pointing at event group. |
| wot-codegen/test/test-cases/failure/ActionEventConfigurationMismatch.json | Adds failure expectations for action using eventConfiguration. |
| wot-codegen/test/test-cases/failure/ActionActionConfigurationWrongType.json | Adds failure expectations for actionConfiguration wrong type. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.