Skip to content

STJM: allow discriminator property to not be first #61

Description

@egil

Some data stores, eg MySQL, will change the order of properties when storing json in a json column: https://dev.mysql.com/doc/refman/8.0/en/json.html

That breaks with the expected placement of the discriminator property, that STJM expects to be the first.

Let's check the setting https://learn.microsoft.com/en-us/dotnet/api/system.text.json.jsonserializeroptions.allowoutofordermetadataproperties?view=net-10.0 and if that is true then scan for the discriminator property.

There is a performance impact of enabling this feature when it is not needed, so let's have it turned off by default.

Let's also research other data storage providers to see which behave like MySQL, then we can list that in the docs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requeststjmEgil.SystemTextJson.Migration scope

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions