Closed ebarnard closed 2 days ago
@ebarnard Thanks for taking the time to suggest this. If NJsonSchema already supports it then it should be trivial to implement. You're more than welcome to try to give it a go and I'll make sure your pull request gets merged in, or I could do it myself.
I'm a bit occupied with work and family these days so it might take a few days for me to build this
@all-contributors please add @ebarnard for ideas
@christianhelle
I've put up a pull request to add @ebarnard! :tada:
@ebarnard I got a bit curious so I looked into this in detail and apparently, Refitter already supports GenerateNativeRecords
but cannot generate immutable records. The immutable records are only generated when ClassStyle
is set to Record
, as you mentioned
This feature will only take a couple of minutes to implement so I'll just do it myself
@ebarnard In the pull request #409, I set the ClassStyle
to either POCO
or Record
depending on whether GenerateNativeRecords
is set. I'll expose the ClassStyle
in the .refitter settings file later as that involves a bit more work
That looks perfect, thank you for looking at this so quickly.
That looks perfect, thank you for looking at this so quickly.
@ebarnard you're welcome
@ebarnard this feature is now released as v1.1.1
Is your feature request related to a problem? Please describe. I'd like to be able to generate immutable records.
NJsonSchema supports this by setting
GenerateNativeRecords = true
andClassStyle = CSharpClassStyle.Record
inCSharpGeneratorSettings
.Describe the solution you'd like Add support for setting
ClassStyle
incodeGeneratorSettings
in the.refitter
file.Describe alternatives you've considered N/A
Additional context N/A