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

No way to override DateTime JsonConvert #1737

Open
falconmick opened this issue Oct 24, 2024 · 0 comments
Open

No way to override DateTime JsonConvert #1737

falconmick opened this issue Oct 24, 2024 · 0 comments

Comments

@falconmick
Copy link

Hey all!

I’m having a hard time trying to define a custom JsonConvert for my C# generation as the default template places [JsonConvert(typeof(DateFormatConverter)] atop each of my dates, and Attributes take priority over JsonSerializerOptions so I cannot make my JsonParse prioritise my converter.

my current solution is to just set all Date, DateTime to be string (and leaving responsibility of extracting the types further down the code base as it’s needed) as the only other solution I could come up with is to override the TemplateDirectory and make a copy of the entire set of templates with the one file I need to change being updated.

is there a better way? Sorry if there is any formatting/grammar I can’t comment publicly from my work account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant