From 5a653297c4dd3d8973d588174a4aa2e313464283 Mon Sep 17 00:00:00 2001 From: Johannes Tuerk Date: Thu, 12 Jun 2025 13:48:20 +0200 Subject: [PATCH] also use the id from the input descriptor to extract the docType Signed-off-by: Johannes Tuerk --- .../PresentationExchange/Models/InputDescriptor.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/WalletFramework.Oid4Vc/Oid4Vp/PresentationExchange/Models/InputDescriptor.cs b/src/WalletFramework.Oid4Vc/Oid4Vp/PresentationExchange/Models/InputDescriptor.cs index b85bd6fd..cdff21e7 100644 --- a/src/WalletFramework.Oid4Vc/Oid4Vp/PresentationExchange/Models/InputDescriptor.cs +++ b/src/WalletFramework.Oid4Vc/Oid4Vp/PresentationExchange/Models/InputDescriptor.cs @@ -156,9 +156,17 @@ public static Option> GetRequestedCredentialType(this InputD .Select>(field => { return DocType.ValidDoctype(field.Filter!.Const!).UnwrapOrThrow(); - }); + }) + .ToList(); - result = types?.ToList() ?? []; + if (types == null || !types.Any()) + { + types = DocType.ValidDoctype(inputDescriptor.Id).Match( + docType => [docType], + _ => new List>()); + } + + result = types; } return result.Count != 0 ? result[0] : Option>.None;