openzim / cms

ZIM file Publishing Platform
https://cms.openzim.org
GNU General Public License v3.0
4 stars 0 forks source link

Add query filtering parameters for `/titles` #49

Closed anshulxyz closed 2 years ago

anshulxyz commented 2 years ago

Closes #41

This is a work-in-progress.

@rgaudin

I have failing BUT valid tests in this PR.

We will use/need exclude_unset refer this https://pydantic-docs.helpmanual.io/usage/exporting_models/ whether fields which were not explicitly set when creating the model should be excluded from the returned dictionary; default False

I am still confused how they are using it here in FastApi https://fastapi.tiangolo.com/tutorial/body-updates/#using-pydantics-exclude_unset-parameter

here's ORMar's same docs for unsetting https://collerek.github.io/ormar/models/methods/#exclude_unset


following is my notes on this issue

Meeting with Renaud at 17:30

Notes

codecov[bot] commented 2 years ago

Codecov Report

Merging #49 (a3eb6e4) into main (660b043) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              main       #49    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files            8         8            
  Lines          244       376   +132     
==========================================
+ Hits           244       376   +132     
Impacted Files Coverage Δ
backend/src/backend/constants.py 100.00% <100.00%> (ø)
backend/src/backend/main.py 100.00% <100.00%> (ø)
backend/src/backend/models.py 100.00% <100.00%> (ø)
backend/src/backend/routes/books.py 100.00% <100.00%> (ø)
backend/src/backend/routes/titles.py 100.00% <100.00%> (ø)
backend/src/backend/schemas.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 660b043...a3eb6e4. Read the comment docs.

anshulxyz commented 2 years ago

Hi @rgaudin all the tests are passing now and I have added a docs. This docstring comment also shows up on the docs page. At v1/docs#/titles/list_titles_titles_get

WARNING: When the flags are set to false (by default), the API still sends those fields in response. The value of those keys are either empty of None.

anshulxyz commented 2 years ago

More tests needs to be written, for the test coverage and some more cases.

stale[bot] commented 2 years ago

This pull request has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.