JSONPatch Serialization .NET Example
Following repo contains an example of a JSON Patch implementation within .NET 7 using a JsonConverter
to parse the Operation
discriminator into the corresponding classes following the Domain Primitive principle.
Add Request
{
"Data": [
"string1",
"string2"
],
"Operation": "Add"
}
becomes
UpdateAddRequest {
Data = System.Collections.Generic.List`1[System.String],
Operation = Add
}
Empty Request
{
}
becomes
UpdateEmptyRequest {
Operation = NotSpecified
}