Skip to content

Commit e5b217f

Browse files
Updated periodic wave options to have real and imag be optional.
1 parent b91979d commit e5b217f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/KristofferStrube.Blazor.WebAudio/Options/PeriodicWaveOptions.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ public class PeriodicWaveOptions : PeriodicWaveConstraints
2020
/// The third represents the first overtone and so on.
2121
/// </summary>
2222
[JsonPropertyName("imag")]
23-
public required float[] Imag { get; set; }
23+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
24+
public float[]? Imag { get; set; }
2425

2526
/// <summary>
2627
/// The real parameter represents an array of cosine terms.
@@ -29,5 +30,6 @@ public class PeriodicWaveOptions : PeriodicWaveConstraints
2930
/// The third represents the first overtone and so on.
3031
/// </summary>
3132
[JsonPropertyName("real")]
32-
public required float[] Real { get; set; }
33+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
34+
public float[]? Real { get; set; }
3335
}

0 commit comments

Comments
 (0)