diff --git a/src/AgentFramework.Core/AgentFramework.Core.csproj b/src/AgentFramework.Core/AgentFramework.Core.csproj index 50c94629..fb7fedcb 100644 --- a/src/AgentFramework.Core/AgentFramework.Core.csproj +++ b/src/AgentFramework.Core/AgentFramework.Core.csproj @@ -15,11 +15,6 @@ bin\$(Configuration)\$(TargetFramework)\AgentFramework.Core.xml $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb - - - - - @@ -29,10 +24,4 @@ - - - - - - diff --git a/src/AgentFramework.Core/Models/Proofs/ProofAttributeInfo.cs b/src/AgentFramework.Core/Models/Proofs/ProofAttributeInfo.cs index 6e89d4b2..98b2e58d 100644 --- a/src/AgentFramework.Core/Models/Proofs/ProofAttributeInfo.cs +++ b/src/AgentFramework.Core/Models/Proofs/ProofAttributeInfo.cs @@ -6,27 +6,31 @@ namespace AgentFramework.Core.Models.Proofs { /// Attribute filter - [JsonConverter(typeof(StringEnumConverter))] - public enum AttributeFilter + public class AttributeFilter { /// The schema identifier - [EnumMember(Value = "schema_id")] - SchemaId, + [JsonProperty("schema_id", NullValueHandling = NullValueHandling.Ignore)] + public string SchemaId { get; set; } + /// The schema issuer did - [EnumMember(Value = "schema_issuer_did")] - SchemaIssuerDid, + [JsonProperty("schema_issuer_did", NullValueHandling = NullValueHandling.Ignore)] + public string SchemaIssuerDid { get; set; } + /// The schema name - [EnumMember(Value = "schema_name")] - SchemaName, + [JsonProperty("schema_name", NullValueHandling = NullValueHandling.Ignore)] + public string SchemaName { get; set; } + /// The schema version - [EnumMember(Value = "schema_version")] - SchemaVersion, + [JsonProperty("schema_version", NullValueHandling = NullValueHandling.Ignore)] + public string SchemaVersion { get; set; } + /// The issuer did - [EnumMember(Value = "issuer_did")] - IssuerDid, + [JsonProperty("issuer_did", NullValueHandling = NullValueHandling.Ignore)] + public string IssuerDid { get; set; } + /// The credential definition identifier - [EnumMember(Value = "cred_def_id")] - CredentialDefinitionId + [JsonProperty("cred_def_id", NullValueHandling = NullValueHandling.Ignore)] + public string CredentialDefinitionId { get; set; } } /// @@ -57,7 +61,7 @@ public class ProofAttributeInfo /// /// The restrictions. [JsonProperty("restrictions", NullValueHandling = NullValueHandling.Ignore)] - public Dictionary Restrictions { get; set; } + public List Restrictions { get; set; } /// /// Gets or sets the non revoked interval. diff --git a/test/AgentFramework.Core.Tests/ConverterTests.cs b/test/AgentFramework.Core.Tests/ConverterTests.cs index 878ff19c..7a11bf77 100644 --- a/test/AgentFramework.Core.Tests/ConverterTests.cs +++ b/test/AgentFramework.Core.Tests/ConverterTests.cs @@ -11,38 +11,6 @@ namespace AgentFramework.Core.Tests { public class ConverterTests { - [Fact] - public void EnumAttributeSerializesToJson() - { - var attributeFilter = new Dictionary - { - {AttributeFilter.CredentialDefinitionId, "123"} - }; - - var json = attributeFilter.ToJson(); - - var jobj = JObject.Parse(json); - - Assert.True(jobj.ContainsKey("cred_def_id")); - Assert.Equal("123", jobj.GetValue("cred_def_id")); - } - - [Fact] - public void EnumAttributeDeserializesFromJson() - { - var attributeFilter = new Dictionary - { - {AttributeFilter.SchemaIssuerDid, "123"} - }; - - var json = attributeFilter.ToJson(); - - var dict = JsonConvert.DeserializeObject>(json); - - Assert.True(dict.ContainsKey(AttributeFilter.SchemaIssuerDid)); - Assert.Equal("123", dict[AttributeFilter.SchemaIssuerDid]); - } - [Fact] public void SerializeAgentMessageWithDecorators() {