Skip to content

Commit

Permalink
More compat
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos committed Feb 11, 2025
1 parent 31d6c8b commit ab5bd40
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 6 additions & 3 deletions src/python-fastui/fastui/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ def __get_pydantic_json_schema__(
) -> _t.Any:
# until https://github.com/pydantic/pydantic/issues/8413 is fixed
json_schema = handler(core_schema)
json_schema['required'].append('level')
schema_def = handler.resolve_ref_schema(json_schema)
schema_def['required'].append('level')
return json_schema


Expand Down Expand Up @@ -309,7 +310,8 @@ def __get_pydantic_json_schema__(
) -> _t.Any:
# until https://github.com/pydantic/pydantic/issues/8413 is fixed
json_schema = handler(core_schema)
json_schema.setdefault('required', []).extend(['startLinks', 'endLinks'])
schema_def = handler.resolve_ref_schema(json_schema)
schema_def.setdefault('required', []).extend(['startLinks', 'endLinks'])
return json_schema


Expand Down Expand Up @@ -523,7 +525,8 @@ def __get_pydantic_json_schema__(
) -> _t.Any:
# add `children` to the schema so it can be used in the client
json_schema = handler(core_schema)
json_schema['properties']['children'] = {'tsType': 'ReactNode'}
schema_def = handler.resolve_ref_schema(json_schema)
schema_def['properties']['children'] = {'tsType': 'ReactNode'}
return json_schema


Expand Down
9 changes: 4 additions & 5 deletions src/python-fastui/requirements/pyproject.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --constraint=src/python-fastui/requirements/lint.txt --extra=fastapi --output-file=src/python-fastui/requirements/pyproject.txt --strip-extras src/python-fastui/pyproject.toml
Expand All @@ -18,20 +18,19 @@ idna==3.6
# via
# anyio
# email-validator
pydantic==2.6.1
pydantic==2.10.6
# via
# fastapi
# fastui (src/python-fastui/pyproject.toml)
# pydantic
pydantic-core==2.16.2
pydantic-core==2.27.2
# via pydantic
python-multipart==0.0.7
# via fastui (src/python-fastui/pyproject.toml)
sniffio==1.3.0
# via anyio
starlette==0.36.3
# via fastapi
typing-extensions==4.9.0
typing-extensions==4.12.2
# via
# fastapi
# pydantic
Expand Down

0 comments on commit ab5bd40

Please sign in to comment.