Skip to content

Please revert static UpdateJsonSerializerSettings #4662

@bkoelman

Description

@bkoelman

When trying to update to v14-preview, I found that our code no longer compiles because the generated UpdateJsonSerializerSettings partial method has been changed to become static. This doesn't work for us, because we provide a NuGet package that contains a base class to hook into the serializer settings, in order to support JSON:API partial patch.

For example:

// In our NuGet package
public abstract class JsonApiClient : IJsonApiClient
{
   protected void SetSerializerSettingsForJsonApi(JsonSerializerSettings settings)
   {
        // implementation relies on instance-based state
   }
}

// Consumer of our NuGet package
public partial class ExampleApiClient : JsonApiClient
{
    partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings)
    {
        SetSerializerSettingsForJsonApi(settings);
    }
}

Would you please consider reverting this change? I can't think of a way to work around it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions