Update ServiceEndpoint
to support sets and maps
#485
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of change
Update the
serviceEndpoint
field ofService
to allow an ordered set or map as well as the current single URL. Note that "ordered" refers to maintaining the order of insertion, not comparison.This is in line with the DID specification: https://www.w3.org/TR/did-core/#dfn-serviceendpoint
One thing to note is that this PR allows empty sets and maps while the spec specifies "one or more". This is mostly due to ergonomics to avoid clunky wrapping types but can be changed if necessary.
Also according to the spec, we should allow nested maps in
serviceEndpoint
sets and maps too. Considering that would complicate the Rust types and usability quite a bit, it was decided not to support nested maps at this time.Links to any relevant issues
Resolves issue #447.
Type of change
Add an
x
to the boxes that are relevant to your changes.How the change has been tested
Describe the tests that you ran to verify your changes.
Make sure to provide instructions for the maintainer as well as any relevant configurations.
Change checklist
Add an
x
to the boxes that are relevant to your changes.