feature: add instance level ref cache #63
Reference in New Issue
Block a user
Delete Branch "feature/add-instance-level-ref-cache"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This pull request introduces a comprehensive refactor focused on improving reference cache handling and type naming for JSON schema parsing and model generation. The changes enforce the use of a dedicated
RefCacheDicttype for reference caching, add cache management utilities, and enhance error and warning reporting for cache-related issues. Additionally, the test suite is updated to ensure proper cache usage and to validate new error/warning behaviors.Reference cache management and API improvements
RefCacheDicttype for consistent reference cache handling across parsers and the schema converter, replacing previous use of plain dictionaries. [1] [2] [3] [4] [5]SchemaConverterto support instance-level reference caching, added methods to clear and query the cache, and updated the build logic to accept and use the cache. [1] [2] [3] [4]Parser behavior and error/warning handling
ObjectTypeParserrequires aref_cacheargument, raisingInternalAssertionExceptionif missing, and added warnings when a type name collision occurs in the cache. [1] [2] [3] [4]AnyOfTypeParserandObjectTypeParserto use dot notation for subtypes, improving clarity and avoiding naming collisions. [1] [2]Test suite updates
ref_cacheargument, ensuring compatibility with the new cache requirements and validating error/warning behaviors. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]Internal API consistency
RefCacheDicttype, ensuring consistent type safety and API clarity. [1] [2]Warnings and error handling in tests
ObjectTypeParserraises errors whenref_cacheis missing and emits warnings when cached types are overridden. [1] [2]Codecov Report
✅ All modified and coverable lines are covered by tests.
📢 Thoughts on this report? Let us know!