Tim
06/20/2023, 8:27 PMthis.serialization.preservecaseforstructkey = true
being ignored in CF2023.
For things that are already structs, that's easy enough -- quote the struct keys, and everything's fine. But for CFCs, I need to convert the component to a struct first in order to do that.
I took a stab at the "Custom Serializer" introduced in CF11, but came to a similar conclusion to Adam in his blog that the implementation here is "rubbish." (https://blog.adamcameron.me/2014/04/coldfusion-11-custom-serialisers-more.html) implementing a serialize
method with 10-15 if/else's in it just makes me want to cry.
and then I have to remember to maintain that when I add new components in the future.
I'm hoping that in the last 10 years, there's become a standard "better way" before I go reinventing the wheel.evagoras
06/20/2023, 9:23 PMcfvonner
06/20/2023, 9:42 PMTim
06/20/2023, 10:08 PMpreservecaseforstructkey
only applies to structs, and not to component properties... So It looks like CF2023 is still preserving case on component properties correctly. It's just structs that it's not doing it for.
Now I wonder where my misunderstanding came from. But I think that means that things are mostly okay as-is.Tim
06/20/2023, 10:08 PM