Conversation
…zation and deserialization
…zation and deserialization
… custom converters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request enhances the source generator logic in
Yamlify.SourceGeneratorto better support custom converters for nested types during YAML serialization and deserialization. The main improvement is that, when a nested type has a custom converter, the generated code now wires up the generated read and write methods to the custom converter, ensuring correct handling of nested serialization logic.Custom Converter Integration for Nested Types:
When generating property or element read logic, if a nested type has a custom converter, the generated code now instantiates the custom converter and sets its
GeneratedReadandGeneratedWritedelegates to point to the generated methods for that nested type. This ensures that custom converters can leverage the generated (de)serialization logic for their nested types. [1] [2]Similarly, when generating property or element write logic, the code now checks for a custom converter and, if present, creates an instance of it with the appropriate delegates wired up, instead of always using the generated converter directly. This is applied consistently for value types, nullable value types, and reference types. [1] [2] [3] [4]