Skip to content

Commit 5a65329

Browse files
committed
also use the id from the input descriptor to extract the docType
Signed-off-by: Johannes Tuerk <johannes.tuerk@lissi.id>
1 parent 0c4566a commit 5a65329

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/WalletFramework.Oid4Vc/Oid4Vp/PresentationExchange/Models/InputDescriptor.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,17 @@ public static Option<OneOf<Vct, DocType>> GetRequestedCredentialType(this InputD
156156
.Select<Field, OneOf<Vct, DocType>>(field =>
157157
{
158158
return DocType.ValidDoctype(field.Filter!.Const!).UnwrapOrThrow();
159-
});
159+
})
160+
.ToList();
160161

161-
result = types?.ToList() ?? [];
162+
if (types == null || !types.Any())
163+
{
164+
types = DocType.ValidDoctype(inputDescriptor.Id).Match(
165+
docType => [docType],
166+
_ => new List<OneOf<Vct, DocType>>());
167+
}
168+
169+
result = types;
162170
}
163171

164172
return result.Count != 0 ? result[0] : Option<OneOf<Vct, DocType>>.None;

0 commit comments

Comments
 (0)