Closed anshulxyz closed 2 years ago
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.
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.
More tests needs to be written, for the test coverage and some more cases.
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.
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 FalseI 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
?metadata-name=wikipedia_fr_test
to filter based on a meta (Name
here). Value can include the*
character (ex:wikipedia_*_maxi
,*_nopic
, etc).Illustration_*
are not supported obviously.?metadata-name=wikipedia_fr_test
?metadata-name=wikipedia_*_all
Illustration_*
?tag=wikipedia,kids
,?tag=wikipedia|wikibooks
?with_metadata=title,scraper,illustration_48x48
: includes the requested metadata in response.all
is a shortcut for including all metadata (including illustration).all_text
is same but only text-ones.illustration
is an alias forillustration_48x48
.?with_languages
: include languages into response?with_languages
just by itself is not supported, it needs some valueFalse
as the defaultbool
typefields()
is not having any effectlanguage
response follow the above style, instead of["eng", "fra"]
?with_tags
: include tags (all) into response.with_languages
andwith_tags
Meeting with Renaud at 17:30
fields("ident")
is not able to remove languages whenselect_related()
is usedwith_languages
is used, don't send "language" key in the response?lang=fra&with_languages=false
?Notes
response_model
for parsing, and then we can customise the response. Note of the pagination working with this new custom response. Refer/titles/{ident}
on how to do this.None
vs[]
, use can still use Pydantic schema?