-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
This affects properties/telemetry, components, and relationships, all of which have a name property.
e.g. Using the following code:
[TwinRelationship(Name = "rel_runs_lines", DisplayName = "Runs Production Lines")]
public IList<ProductionLine> RunsLines { get; } = new List<ProductionLine>();
The serialization outputs with the name runsLines instead of rel_runs_lines as expected:
{
"target": "dtmi:factoryexample:models:productionline;1",
"name": "runsLines",
"@type": "Relationship",
"displayName": "Runs Production Lines"
}
The output should have "name": "rel_runs_lines"
The fix is:
- to first add some unit tests,
- then to override if the attribute property is set, similar to how Schema is handled. Make it consistent across the different attributes
e.g.
propertyAttribute!.Name ?? info.Name.ToCamelCase()
Also need to fix the Schema override so it works for Telemetry (not just Property).
Metadata
Metadata
Assignees
Labels
No labels