feature: stabilized the new instance method and adds docs #64
Reference in New Issue
Block a user
Delete Branch "feature/alters-library-api"
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 significant improvements to the documentation and refactors the API for building Pydantic models from JSON Schema, focusing on better cache management and clearer usage patterns. The main changes include renaming the instance method for building models with a cache, updating all references and tests to use the new method, and expanding the documentation to explain the reference cache and its usage in detail.
Documentation improvements
docs/source/usage.ref_cache.rst, detailing the reference cache mechanism, its configuration, usage patterns, and API for inspecting and managing cached types.docs/source/usage.rstto clarify the difference between static and instance methods, provide examples for both, and reference the new cache documentation. [1] [2] [3]API refactoring
build_with_instancetobuild_with_cacheinSchemaConverter, making its purpose and behavior clearer and more consistent with the documentation.buildmethod to clarify that it does not use a persistent reference cache unless one is provided.Test suite updates
tests/test_schema_converter.pyto use the newbuild_with_cachemethod name, ensuring consistency and correctness with the updated API. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]Doesn't break backwards compatibility