Skip to content

Commit

Permalink
Init properties cannot be deserialized with source generation. Switch…
Browse files Browse the repository at this point in the history
…ing to optional parameters. (#120)
  • Loading branch information
jrmccannon authored Feb 28, 2024
1 parent 72d00b5 commit 769a423
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions src/Passwordless/Models/Credential.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ namespace Passwordless;
/// <param name="Device">Device the credential was created on.</param>
/// <param name="Nickname">Friendly name for credential.</param>
/// <param name="UserId">Identifier for the user.</param>
/// <para name="BackupState">Whether the credential is synced (or backed up or not).</para>
/// <para name="IsBackupEligible">Whether the credential is eligible for backup or syncing.</para>
/// <para name="IsDiscoverable">Whether the credential is discoverable.</para>
public record Credential(
CredentialDescriptor Descriptor,
byte[] PublicKey,
Expand All @@ -34,20 +37,7 @@ public record Credential(
string Country,
string Device,
string Nickname,
string UserId)
{
/// <summary>
/// Whether the credential is synced (or backed up or not).
/// </summary>
public bool? BackupState { get; init; }

/// <summary>
/// Whether the credential is eligible for backup or syncing.
/// </summary>
public bool? IsBackupEligible { get; init; }

/// <summary>
/// Whether the credential is discoverable.
/// </summary>
public bool? IsDiscoverable { get; init; }
}
string UserId,
bool? BackupState = null,
bool? IsBackupEligible = null,
bool? IsDiscoverable = null);

0 comments on commit 769a423

Please sign in to comment.