Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
reinkrul committed Nov 30, 2023
1 parent d9d7dc1 commit 940e6a2
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions did/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,21 +265,7 @@ type Service struct {
ServiceEndpoint interface{} `json:"serviceEndpoint,omitempty"`
}

func (s *Service) UnmarshalJSON(data []byte) error {
normalizedData, err := marshal.NormalizeDocument(data, pluralContext)
if err != nil {
return err
}
type alias Service
var result alias
if err := json.Unmarshal(normalizedData, &result); err != nil {
return err
}
*s = (Service)(result)
return nil
}

// Unmarshal unmarshalls the service endpoint into a domain-specific type.
// UnmarshalServiceEndpoint unmarshalls the service endpoint into a domain-specific type.
func (s Service) UnmarshalServiceEndpoint(target interface{}) error {
var valueToMarshal interface{}
if asSlice, ok := s.ServiceEndpoint.([]interface{}); ok && len(asSlice) == 1 {
Expand Down

0 comments on commit 940e6a2

Please sign in to comment.