Change URI to IRI after finding validation pattern

This commit is contained in:
2024-10-16 17:33:25 +02:00
parent b76e529ca3
commit 082e71a698
10 changed files with 41 additions and 32 deletions

View File

@@ -10,7 +10,7 @@ import (
type Person struct {
*CommonAttributes
Name string `xml:"name"`
URI URI `xml:"uri,omitempty"`
URI IRI `xml:"uri,omitempty"`
Email EmailAddress `xml:"email,omitempty"`
Extensions []*ExtensionElement `xml:",any,omitempty"`
}
@@ -29,7 +29,7 @@ func (p *Person) Check() error {
}
if p.URI != "" {
if !isValidURI(p.URI) {
if !isValidIRI(p.URI) {
return fmt.Errorf("uri element of person %v not correctly formatted", p.Name)
}
}