Skip to content

Commit

Permalink
Add context only for LinkedDomains
Browse files Browse the repository at this point in the history
  • Loading branch information
DaevMithran committed Sep 10, 2024
1 parent e869fd8 commit e05adcf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions services/diddoc_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ func (dds DIDDocService) Resolve(did string, version string, contentType types.C
if didResolutionMetadata.ContentType == types.DIDJSONLD || didResolutionMetadata.ContentType == types.JSONLD {
didDoc.AddContext(types.DIDSchemaJSONLD)

if len(didDoc.Service) > 0 {
didDoc.AddContext(types.DIFDIDConfigurationJSONLD)
for _, service := range didDoc.Service {
switch service.Type {

Check failure on line 58 in services/diddoc_service.go

View workflow job for this annotation

GitHub Actions / Lint / Golang Lint

singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
case types.LinkedDomains:
didDoc.AddContext(types.DIFDIDConfigurationJSONLD)
}
}

for _, method := range didDoc.VerificationMethod {
Expand Down
1 change: 1 addition & 0 deletions types/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const (
VersionId string = "versionId"
VersionTime string = "versionTime"
TransformKeys string = "transformKeys"
LinkedDomains string = "LinkedDomains"
Metadata string = "metadata"
ServiceQ string = "service"
RelativeRef string = "relativeRef"
Expand Down

0 comments on commit e05adcf

Please sign in to comment.