improve IAM module

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2020-05-22 09:35:05 +08:00
parent 0d12529051
commit 8f93266ec0
640 changed files with 50221 additions and 18179 deletions

View File

@@ -104,7 +104,7 @@ func GuessBestListPathElement(index int, item value.Value) PathElement {
return PathElement{Index: &index}
}
var keys []value.Field
var keys value.FieldList
for _, name := range AssociativeListCandidateFieldNames {
f, ok := item.MapValue.Get(name)
if !ok {
@@ -117,7 +117,8 @@ func GuessBestListPathElement(index int, item value.Value) PathElement {
keys = append(keys, *f)
}
if len(keys) > 0 {
return PathElement{Key: &value.Map{Items: keys}}
keys.Sort()
return PathElement{Key: &keys}
}
return PathElement{Index: &index}
}