Added support for serializing IEnumerables & structs.#333
Merged
Conversation
…stfix # Conflicts: # .github/workflows/integration_tests.yml
umeshma
approved these changes
Jul 6, 2026
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 significantly improves the handling of .NET collection, dictionary, and value types during schema export, ensuring that the generated TypeScript schemas more accurately reflect JSON serialization behavior. The changes address previous issues where collections and certain value types (like Guid and DateTime) were incorrectly exported as empty interfaces or leaked internal implementation details. The update also adds comprehensive tests to verify correct schema generation for a wide variety of types.
Improvements to type handling and schema export:
IEnumerable<T>,List<T>, etc.) and dictionary-like (IDictionary<K,V>,Dictionary<K,V>, etc.) types, ensuring they are exported as TypeScript arrays and maps respectively, without leaking internal .NET implementation details. [1] [2] [3] [4] [5] [6] [7]Guid,DateTime,DateTimeOffset,DateOnly,TimeOnly) to TypeScriptstringtype, preventing them from being exported as empty interfaces. [1] [2] [3]Test coverage enhancements:
Schemas.csto cover collections, dictionaries, self-referential enumerables, and structs, verifying correct schema export for each case.These changes collectively make schema generation more robust, accurate, and aligned with how .NET types are serialized to JSON, while also preventing schema bloat and infinite recursion in pathological cases.
Fixes: #218