Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed leftover System.Text.Json dependencies #16040

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

kjac
Copy link
Contributor

@kjac kjac commented Apr 12, 2024

Prerequisites

  • I have added steps to test this contribution in the description below

Description

A few property value editors have a direct dependency on System.Text.Json. While this works just fine, they really should not have that dependency. But at this point they're forced to.

This PR introduces a new method on IJsonSerializer, which allows for attempting a deserialization of any (JSON) object, thus removing the need for direct dependencies on the concrete JSON implementation.

Unit tests included.

As the current IJsonSerializer and IConfigurationEditorJsonSerializer implementations are virtually identical apart from the JSON configurations, I have abstracted their implementation into a base class, so I didn't have to duplicate the implementation of the TryDeserialize method too.

Testing this PR

Nothing should change functionality wise.

Verify that you are still able to save content with properties based on the affected property value editors (slider, image cropper, media picker).

@bergmania bergmania merged commit 576b360 into v14/dev Apr 15, 2024
17 checks passed
@bergmania bergmania deleted the v14/fix/remove-json-dependencies branch April 15, 2024 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants