pymongo filter_fields should default to None, not {}
The new filter_fields argument in pymongo changes from None to {}, as with query_filter.
https://github.com/uriyyo/fastapi-pagination/blob/91cdd7a706705d8c5d0dbe51d690fb3db06c4803/fastapi_pagination/ext/pymongo.py#L31
However, in pymongo None means "perform no filtering" and {} means "return only the ObjectId".
So, this results in errors of the following kind:
pydantic_core._pydantic_core.ValidationError: 3 validation errors for Page[Peripheral]
items.0.peripheralID
Field required [type=missing, input_value={'_id': ObjectId('6286cafb01072e1f8a55b7ca')}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.5/v/missing
I think this is as simple as removing the linked line to fix the problem.
@spr Thanks for reporting this issue, will try to fix it ASAP
Thanks for the quick fix!
@spr I am planing to release fix tomorrow. I will notify you, when it will be ready
Hi @spr,
New version 0.12.14 has been released, this issue should be fixed.
Hi @spr,
I am closing this issue, please reopen it in case if issue still exists on your side