File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
src/WalletFramework.Oid4Vc/Oid4Vp/Dcql/CredentialQueries Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -58,8 +58,15 @@ public static Validation<CredentialQuery> FromJObject(JObject json)
58
58
{
59
59
var id = json . GetByKey ( IdJsonKey )
60
60
. OnSuccess ( token => token . ToJValue ( ) )
61
- . OnSuccess ( value => CredentialQueryId . Create ( value . Value ? . ToString ( ) ?? string . Empty ) )
62
- . ToOption ( ) ;
61
+ . OnSuccess ( value =>
62
+ {
63
+ if ( string . IsNullOrWhiteSpace ( value . Value ? . ToString ( ) ) )
64
+ {
65
+ return new StringIsNullOrWhitespaceError < CredentialQueryId > ( ) ;
66
+ }
67
+
68
+ return CredentialQueryId . Create ( value . Value . ToString ( ) ) ;
69
+ } ) ;
63
70
64
71
var format = json . GetByKey ( FormatJsonKey )
65
72
. OnSuccess ( token => token . ToJValue ( ) )
@@ -99,13 +106,13 @@ public static Validation<CredentialQuery> FromJObject(JObject json)
99
106
}
100
107
101
108
private static CredentialQuery Create (
102
- Option < CredentialQueryId > id ,
109
+ CredentialQueryId id ,
103
110
string format ,
104
111
CredentialMetaQuery meta ,
105
112
Option < IEnumerable < ClaimQuery > > claims ,
106
113
Option < IEnumerable < ClaimSet > > claimSets ) => new ( )
107
114
{
108
- Id = id . ToNullable ( ) ,
115
+ Id = id ,
109
116
Format = format ,
110
117
Meta = meta ,
111
118
Claims = claims . ToNullable ( ) ? . ToArray ( ) ,
You can’t perform that action at this time.
0 commit comments