Closed Greven145 closed 8 months ago
Sorry for the delay with this 😳. I agree on both points! I'm currently working on a big redesign of the library in this PR:
The main idea is to make the library much more maintainable while also giving people a mechanism to customise the generated IDs as much as they like. In that PR I've made both of these changes, but you'll be able to completely customise the generated IDs too 🙂
I have a case where I want to use my strongly typed id as a dictionary key when deserializing from JSON.
I'm using
System.Text.Json
and I get an errorThe type 'MyId' is not a supported dictionary key using converter of type 'MyId+MyIdSystemTextJsonConverter'
.I can see two options, and maybe both would be useful
Have the generated converter classes defined as partial classes. This would allow me to extend in code in my class with the additional overrides I might want
ReadAsPropertyName
andWriteAsPropertyName
Currently I cannot add a second
[System.Text.Json.Serialization.JsonConverter(typeof(MyMyIdConverter))]
attribute, so I'm forced to use JSON serializer options whenever I want to deserialize.If you agree this/these are something you'd like, I'd be happy to open a pull request