feature: stabilized the new instance method and adds docs #64

Merged
HideyoshiNakazone merged 2 commits from feature/alters-library-api into main 2025-11-26 03:05:15 +00:00
Showing only changes of commit 20872d4a91 - Show all commits

View File

@@ -22,7 +22,7 @@ class SchemaConverter:
ref_cache = dict() ref_cache = dict()
self._ref_cache = ref_cache self._ref_cache = ref_cache
def build_with_instance( def build_with_cache(
self, self,
schema: JSONSchema, schema: JSONSchema,
ref_cache: Optional[RefCacheDict] = None, ref_cache: Optional[RefCacheDict] = None,
@@ -55,6 +55,7 @@ class SchemaConverter:
) -> type[BaseModel]: ) -> type[BaseModel]:
""" """
Converts a JSON Schema to a Pydantic model. Converts a JSON Schema to a Pydantic model.
This method doesn't use a reference cache if none is provided.
:param schema: The JSON Schema to convert. :param schema: The JSON Schema to convert.
:param ref_cache: An optional reference cache to use during conversion, if provided `with_clean_cache` will be ignored. :param ref_cache: An optional reference cache to use during conversion, if provided `with_clean_cache` will be ignored.
:return: The generated Pydantic model. :return: The generated Pydantic model.