Deadwood-ai / deadwood-api

Main FastAPI application for the deadwood backend
GNU General Public License v3.0
0 stars 0 forks source link

pydantic does not like posix path object #36

Closed cmosig closed 5 days ago

cmosig commented 4 weeks ago
api-1      | cog_folder
api-1      |   Input should be a valid string [type=string_type, input_value=PosixPath('/data/cogs/683...rsat_2017_CFB044_ortho'), input_type=PosixPath]
api-1      |     For further information visit https://errors.pydantic.dev/2.8/v/string_type

Tested fix: cast to string here with str(cog_folder):

https://github.com/Deadwood-ai/deadwood-api/blob/1eac80fbedc581bf000aae48b705a2ad37e79706/src/routers/cog.py#L96