Skip to content

Presets BE: Add Pydantic 2 and latest FastAPI

Closes #46 (closed)

What has been done

Updated the requirements.txt with the newest version of Pydantic and FastAPI. Also made some corrections including replacements for deprecated functions that are replaced in the new Pydantic.

How it can be tested

  • Start the backend locally and connect with the FE.
  • Make sure no changes in functionalities.
  • Run the unit tests, they should all succeed.
  • Be aware that the content of error messages may have changed slightly (as can be seen in the changes in the test files).

Overview of changes

app/crud/view_preset.py & app/crud/workspace_preset.py: replace deprecated validate_arguments for validate_call.

app/models.py: Add default value None.

app/routers/view_preset.py & app/routers/workspace_preset.py: Replace deprecated parse_obj for model_validate and wrap the response header Location into a str type.

requirements.txt: updated the following packages:

  • fastapi
  • pydantic
  • SQLAlchemy
  • sqlmodel
  • starlette
  • typing_extensions
  • uvicorn
Edited by Nick van Unen

Merge request reports