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

Support OnXXX methods/attributes for System.Text.Json #39896

Closed
StevenRasmussen opened this issue Jul 24, 2020 · 3 comments
Closed

Support OnXXX methods/attributes for System.Text.Json #39896

StevenRasmussen opened this issue Jul 24, 2020 · 3 comments
Assignees
Labels
api-suggestion Early API idea and discussion, it is NOT ready for implementation area-System.Text.Json
Milestone

Comments

@StevenRasmussen
Copy link

I saw issue #29177 which is currently closed. However, it talks about both converts and the OnXXX methods but only converters has been implemented. I was really hoping this was on the roadmap for completion in the .Net 5 timeframe but don't see a separate ticket for this so I apologize if there is another ticket already open for this.

Writing a custom converter for every type for which you want to be able to provide OnXXX methods is quite a pain. Being able to create a base class with these methods and then being able to override them in inheriting classes has been my pattern which works quite well with Newtonsoft.Json.

@StevenRasmussen StevenRasmussen added the api-suggestion Early API idea and discussion, it is NOT ready for implementation label Jul 24, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Text.Json untriaged New issue has not been triaged by the area owner labels Jul 24, 2020
@layomia
Copy link
Contributor

layomia commented Jul 27, 2020

We won't get to this in 5.0, but it can be considered in the next release. See the JSON docs for an example workaround for these callbacks.

@layomia
Copy link
Contributor

layomia commented Jun 28, 2021

@steveharter is this issue a duplicate of #54528?

@steveharter
Copy link
Member

@steveharter is this issue a duplicate of #54528?

Yes. Since this issue didn't propose an API I created the API issue instead.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-suggestion Early API idea and discussion, it is NOT ready for implementation area-System.Text.Json
Projects
None yet
Development

No branches or pull requests

5 participants