From 41d7c1f9b58ef604ba25454d35943dcb3c6bab5c Mon Sep 17 00:00:00 2001 From: Firas Qutishat Date: Sun, 16 Oct 2022 09:52:17 -0400 Subject: [PATCH] fix: id format in vp Signed-off-by: Firas Qutishat --- pkg/doc/verifiable/presentation.go | 3 +-- pkg/doc/verifiable/presentation_test.go | 10 ++++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/pkg/doc/verifiable/presentation.go b/pkg/doc/verifiable/presentation.go index eda049bf9..9bc42acb4 100644 --- a/pkg/doc/verifiable/presentation.go +++ b/pkg/doc/verifiable/presentation.go @@ -56,8 +56,7 @@ const basePresentationSchema = ` ] }, "id": { - "type": "string", - "format": "uri" + "type": "string" }, "type": { "oneOf": [ diff --git a/pkg/doc/verifiable/presentation_test.go b/pkg/doc/verifiable/presentation_test.go index 17043a083..0b04fbcb7 100644 --- a/pkg/doc/verifiable/presentation_test.go +++ b/pkg/doc/verifiable/presentation_test.go @@ -348,16 +348,14 @@ func TestValidateVP_Context(t *testing.T) { } func TestValidateVP_ID(t *testing.T) { - t.Run("rejects verifiable presentation with non-url ID", func(t *testing.T) { + t.Run("accept verifiable presentation with string ID", func(t *testing.T) { raw := &rawPresentation{} require.NoError(t, json.Unmarshal([]byte(validPresentation), &raw)) - raw.ID = "not valid presentation ID URL" + raw.ID = "id" bytes, err := json.Marshal(raw) require.NoError(t, err) - vp, err := newTestPresentation(t, bytes) - require.Error(t, err) - require.Contains(t, err.Error(), "id: Does not match format 'uri'") - require.Nil(t, vp) + _, err = newTestPresentation(t, bytes) + require.NoError(t, err) }) }