COVESA / vss-tools

Software for working with VSS (https://github.com/COVESA/vehicle_signal_specification)
Mozilla Public License 2.0
55 stars 56 forks source link

Struct support - Validate against circular references #266

Closed kkoppolu1 closed 1 year ago

kkoppolu1 commented 1 year ago

A struct's property can reference other structs. See https://github.com/COVESA/vehicle_signal_specification/blob/master/docs-gen/content/rule_set/data_entry/data_types_struct.md#structure-in-structure

However, we should prevent properties from having circular references. A property cannot reference the same struct to which the property belongs.

An example of a circular reference:

ParentStruct:
  type: struct
  description: "A struct that is going to contain properties that are circular refs"

ParentStruct.x_property:
  type: property
  datatype: double

ParentStruct.no_property:
  type: property
  description: "Circular reference!"
  datatype: ParentStruct
erikbosch commented 1 year ago

Pr merged, closing it