Skip to content

Commit de60741

Browse files
egilCopilot
andcommitted
fix(stjm): add missing IMigrateFrom interface to PerfStaticV2
PerfStaticV2 had a TryMigrateFrom method but did not declare IMigrateFrom<PerfStaticV1, PerfStaticV2> in its interface list. The library discovers static migrators by the interface, not just the method signature, so the StaticMigration benchmarks threw 'No migrator was found for discriminator'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5953240 commit de60741

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Egil.SystemTextJson.Migration/perf/Egil.SystemTextJson.Migration.PerfTests/MigrationScenarioBenchmarks.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public static PerfStaticPlainV2 ManualFrom(PerfStaticPlainV1 source)
224224
public record class PerfStaticV1(string Name, int Age, string[] Tags);
225225

226226
[JsonMigratable]
227-
public record class PerfStaticV2(string FirstName, string LastName, int Age, string[] Tags) : IJsonMigrationTracked
227+
public record class PerfStaticV2(string FirstName, string LastName, int Age, string[] Tags) : IJsonMigrationTracked, IMigrateFrom<PerfStaticV1, PerfStaticV2>
228228
{
229229
[JsonIgnore]
230230
public bool MigratedDuringDeserialization { get; set; }

0 commit comments

Comments
 (0)