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

Coupling of Ulid and System.Text.Json #79

Open
manfred-brands opened this issue Jul 23, 2024 · 4 comments
Open

Coupling of Ulid and System.Text.Json #79

manfred-brands opened this issue Jul 23, 2024 · 4 comments
Labels

Comments

@manfred-brands
Copy link

Even though there is a separate Ulid.SystemTextJson project, containing the JsonConverter for Ulid.
However the converter is already in the Ulid project which now has a hard-coded reference on System.Text.Json

I know it is convenient to have this attribute, but it is coupling.

Can this be decoupled?
We have users on both NewtonSoft.Json and System.Text.Json and don't want to pull in the 2nd when using the 1st.
We also have code using protobuf which should not pull in any Json package.

@neuecc
Copy link
Member

neuecc commented Jul 23, 2024

I don't see a problem since there is no reference to an additional System.Text.Json, what is your concern?
https://github.com/Cysharp/Ulid/blob/master/src/Ulid/Ulid.csproj

@manfred-brands
Copy link
Author

I was equally confused by that, but ILSpy shows that dependency. Also the JsonConverter wouldn't compile without that reference.

@neuecc
Copy link
Member

neuecc commented Jul 24, 2024

I don't think it exists in NuGet's dependencies either.
https://www.nuget.org/packages/Ulid#dependencies-body-tab
Of course, the new .NET has System.Text.Json in corelib, so it is referenced by default.
The Ulid.SystemTextJson project exists as a package to support environments where System.Text.Json does not exist in the standard, such as netstandard 2.0.

Copy link
Contributor

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants