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 {
// AttributeDescription is a description of an attribute within a credential type.
type AttributeDescription struct {
ID string `xml:"id,attr"`
Optional string `xml:"optional,attr" json:",omitempty"`
Index *int `xml:"index,attr" json:",omitempty"`
Name TranslatedString
Description TranslatedString
ID string `xml:"id,attr"`
Optional string `xml:"optional,attr" json:",omitempty"`
DisplayIndex *int `xml:"displayIndex,attr" json:",omitempty"`
Name TranslatedString
Description TranslatedString
}
func (ad AttributeDescription) GetAttributeTypeIdentifier(cred CredentialTypeIdentifier) AttributeTypeIdentifier {
......
......@@ -1048,8 +1048,8 @@ func (conf *Configuration) checkAttributes(cred *CredentialType) error {
for i, attr := range cred.Attributes {
conf.checkTranslations(fmt.Sprintf("Attribute %s of credential type %s", attr.ID, cred.Identifier().String()), attr)
index := i
if attr.Index != nil {
index = *attr.Index
if attr.DisplayIndex != nil {
index = *attr.DisplayIndex
}
if index >= count {
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