-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Currently, the fast-path source generator will use the TryFilterSerializableProps method to determine the properties that are serializable. The results are returned as a dictionary, which the source generator will enumerate in order to emit the relevant logic.
Note that dictionary enumeration does not provide any guarantees on ordering, as such it is likely that this could end up not honoring the desired serialization order (e.g. as specified by the JsonPropertyOrderAttribute). That being said, the current implementation of System.Collections.Generic.Dictionary happens to preserve ordering due to an implementation detail that may well change in the future. We should update the TryFilterSerializableProps method to provide more robust guarantees on property ordering.