diff --git a/parser.go b/parser.go index 9e6e93c..8174793 100644 --- a/parser.go +++ b/parser.go @@ -67,6 +67,15 @@ func sortProperties(props []*Property) []*Property { for _, n := range names { sorted = append(sorted, pMap[n]) } + + // In case the top level property contains another property internally, + // sort them recursively. + for _, p := range sorted { + if p.InlineProperties != nil { + p.InlineProperties = sortProperties(p.InlineProperties) + } + } + return sorted }