Commit fed9e19e authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Rename AttributeDescription.Index -> DisplayIndex

parent c13a0cd9
...@@ -64,11 +64,11 @@ type CredentialType struct { ...@@ -64,11 +64,11 @@ type CredentialType struct {
// AttributeDescription is a description of an attribute within a credential type. // AttributeDescription is a description of an attribute within a credential type.
type AttributeDescription struct { type AttributeDescription struct {
ID string `xml:"id,attr"` ID string `xml:"id,attr"`
Optional string `xml:"optional,attr" json:",omitempty"` Optional string `xml:"optional,attr" json:",omitempty"`
Index *int `xml:"index,attr" json:",omitempty"` DisplayIndex *int `xml:"displayIndex,attr" json:",omitempty"`
Name TranslatedString Name TranslatedString
Description TranslatedString Description TranslatedString
} }
func (ad AttributeDescription) GetAttributeTypeIdentifier(cred CredentialTypeIdentifier) AttributeTypeIdentifier { func (ad AttributeDescription) GetAttributeTypeIdentifier(cred CredentialTypeIdentifier) AttributeTypeIdentifier {
......
...@@ -1048,8 +1048,8 @@ func (conf *Configuration) checkAttributes(cred *CredentialType) error { ...@@ -1048,8 +1048,8 @@ func (conf *Configuration) checkAttributes(cred *CredentialType) error {
for i, attr := range cred.Attributes { for i, attr := range cred.Attributes {
conf.checkTranslations(fmt.Sprintf("Attribute %s of credential type %s", attr.ID, cred.Identifier().String()), attr) conf.checkTranslations(fmt.Sprintf("Attribute %s of credential type %s", attr.ID, cred.Identifier().String()), attr)
index := i index := i
if attr.Index != nil { if attr.DisplayIndex != nil {
index = *attr.Index index = *attr.DisplayIndex
} }
if index >= count { if index >= count {
conf.Warnings = append(conf.Warnings, fmt.Sprintf("Credential type %s has invalid attribute index at attribute %d", name, i)) conf.Warnings = append(conf.Warnings, fmt.Sprintf("Credential type %s has invalid attribute index at attribute %d", name, i))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment