Skip to content

Commit

Permalink
Make field range elements explicit in data model
Browse files Browse the repository at this point in the history
  • Loading branch information
hasty committed Mar 1, 2025
1 parent 9af2ab6 commit 3d8c9a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dm/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func renderCommands(doc *spec.Doc, cluster *matter.Cluster, c *etree.Element) (e
i.CreateAttr("name", f.Name)
renderDataType(f, i)
if !constraint.IsBlankLimit(f.Fallback) {
i.CreateAttr("default", f.Fallback.ASCIIDocString(f.Type))
renderConstraintLimit(i, f.Fallback, f.Type, "default", nil)
}
err = renderAnonymousType(doc, cluster, i, f)
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions dm/constraint.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ func renderLogicalLimit(parent *etree.Element, limit *constraint.LogicalLimit, d
}

func renderConstraintReferenceLimit(parent *etree.Element, field constraint.Limit, limit constraint.Limit, dataType *types.DataType, name string, entity types.Entity, ref string, parentEntity types.Entity) bool {
if name != "value" {
parent = parent.CreateElement(name)
}
switch entity := entity.(type) {
case *matter.EnumValue:
el := parent.CreateElement("enum")
Expand Down

0 comments on commit 3d8c9a8

Please sign in to comment.