Rule of thumb is that all list endpoints should use the same wrapping schema with the meta info for pagination. It means that it should also accept skip and limit parameters to control the result list. This is similar to what the zimfarm API does.
Now, this endpoint is gonna be the most used and must be versatile so it serves most if not all of the UI's needs (as well as other needs). It thus needs to allow filtering and payload-control using GET parameters.
Filters:
?lang=fra,eng to filter results based on ISO-639-3 lang codes (intersection)
?lang=fra|eng to filter results based on ISO-639-3 lang codes (union)
?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.
?tag=wikipedia,kids, ?tag=wikipedia|wikibooks to filter results based on Tag (intersection and union) with support for exclusion: tag=wikipedia,!fun|ted,kids (matches Titles with wikipedia or ted that also have the kids tag and not the fun tag) !wikipedia would match all but the wikipedia ones.
Payload-control:
?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 for illustration_48x48.
?with_tags: include tags (all) into response.
?with_languages: include languages into response.
Complete complex request: GET /titles?lang=fra&metadata-scraper=*1.11&tag=!wikipedia&with_tags&with_languages&with_medata=all
This issue 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.
refer https://github.com/openzim/cms/issues/29#issuecomment-987848283
GET
/titles
:Rule of thumb is that all list endpoints should use the same wrapping schema with the meta info for pagination. It means that it should also accept
skip
andlimit
parameters to control the result list. This is similar to what the zimfarm API does.Now, this endpoint is gonna be the most used and must be versatile so it serves most if not all of the UI's needs (as well as other needs). It thus needs to allow filtering and payload-control using GET parameters.
Filters:
?lang=fra,eng
to filter results based on ISO-639-3 lang codes (intersection)?lang=fra|eng
to filter results based on ISO-639-3 lang codes (union)?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.?tag=wikipedia,kids
,?tag=wikipedia|wikibooks
to filter results based on Tag (intersection and union) with support for exclusion:tag=wikipedia,!fun|ted,kids
(matches Titles with wikipedia or ted that also have the kids tag and not the fun tag)!wikipedia
would match all but the wikipedia ones.Payload-control:
?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_tags
: include tags (all) into response.?with_languages
: include languages into response.Complete complex request:
GET /titles?lang=fra&metadata-scraper=*1.11&tag=!wikipedia&with_tags&with_languages&with_medata=all