feat(api): add like operators and additional filters (#4)

This commit is contained in:
paranarimasu
2021-07-11 16:32:18 -05:00
committed by GitHub
parent b31473292b
commit 2a2c86ac7d
15 changed files with 57 additions and 16 deletions
+4 -1
View File
@@ -21,7 +21,7 @@ GET /api/anime/
| fields | No | Sparse fieldsets for resource types |
| include | No | Inclusion of related resources |
| filter | No | Filters for anime resources & constraining the inclusion of related resources |
| sort | No | The list of fields to sort the resources. |
| sort | No | The list of fields to sort the resources |
| q | No | The query to search for matching anime resources |
| page[size] | No | The number of anime resources to display for the current page |
| page[number] | No | The page of anime resources to display |
@@ -39,8 +39,11 @@ GET /api/anime/
## Filters
* name
* slug
* year
* season
* synopsis
* created_at
* updated_at
* deleted_at
+1
View File
@@ -34,6 +34,7 @@ GET /api/announcement/
## Filters
* content
* created_at
* updated_at
* deleted_at
+3 -1
View File
@@ -21,7 +21,7 @@ GET /api/artist/
| fields | No | Sparse fieldsets for resource types |
| include | No | Inclusion of related resources |
| filter | No | Filters for artist resources & constraining the inclusion of related resources |
| sort | No | The list of fields to sort the resources. |
| sort | No | The list of fields to sort the resources |
| q | No | The query to search for matching artist resources |
| page[size] | No | The number of artist resources to display for the current page |
| page[number] | No | The page of artist resources to display |
@@ -37,6 +37,8 @@ GET /api/artist/
## Filters
* name
* slug
* created_at
* updated_at
* deleted_at
+1
View File
@@ -42,6 +42,7 @@ GET /api/balance/
* date
* service
* frequency
* usage
* created_at
* updated_at
* deleted_at
+3 -1
View File
@@ -21,7 +21,7 @@ GET /api/entry/
| fields | No | Sparse fieldsets for resource types |
| include | No | Inclusion of related resources |
| filter | No | Filters for entry resources & constraining the inclusion of related resources |
| sort | No | The list of fields to sort the resources. |
| sort | No | The list of fields to sort the resources |
| q | No | The query to search for matching entry resources |
| page[size] | No | The number of entry resources to display for the current page |
| page[number] | No | The page of entry resources to display |
@@ -40,8 +40,10 @@ GET /api/entry/
## Filters
* version
* episodes
* nsfw
* spoiler
* notes
* created_at
* updated_at
* deleted_at
+3
View File
@@ -38,6 +38,9 @@ GET /api/image/
## Filters
* path
* size
* mimetype
* facet
* created_at
* updated_at
+19 -5
View File
@@ -408,35 +408,49 @@ NE
```sh
# This will match anime not of year 2000
/api/anime?filter[year][ne]=2000
```
```
LT
```sh
# This will match anime where the year is less than 2000
/api/anime?filter[year][lt]=2000
```
```
GT
```sh
# This will match anime where the year is greater than 2000
/api/anime?filter[year][gt]=2000
```
```
LTE
```sh
# This will match anime where the year is less than or equal to 2000
/api/anime?filter[year][lte]=2000
```
```
GTE
```sh
# This will match anime where the year is greater than 2000
/api/anime?filter[year][gte]=2000
```
```
LIKE
```sh
# This will match anime where the name matches the pattern '%monogatari%'
/api/anime?filter[name][like]=%monogatari%
```
NOT LIKE
```sh
# This will match anime where the name does not match the pattern '%monogatari%'
/api/anime?filter[name][notlike]=%monogatari%
```
If a comparison operator is not provided, the filter shall use the EQ operator.
+2
View File
@@ -37,6 +37,8 @@ GET /api/resource/
## Filters
* link
* external_id
* site
* created_at
* updated_at
+3 -1
View File
@@ -21,7 +21,7 @@ GET /api/series/
| fields | No | Sparse fieldsets for resource types |
| include | No | Inclusion of related resources |
| filter | No | Filters for series resources & constraining the inclusion of related resources |
| sort | No | The list of fields to sort the resources. |
| sort | No | The list of fields to sort the resources |
| q | No | The query to search for matching series resources |
| page[size] | No | The number of series resources to display for the current page |
| page[number] | No | The page of series resources to display |
@@ -37,6 +37,8 @@ GET /api/series/
## Filters
* name
* slug
* created_at
* updated_at
* deleted_at
+2 -1
View File
@@ -21,7 +21,7 @@ GET /api/song/
| fields | No | Sparse fieldsets for resource types |
| include | No | Inclusion of related resources |
| filter | No | Filters for song resources & constraining the inclusion of related resources |
| sort | No | The list of fields to sort the resources. |
| sort | No | The list of fields to sort the resources |
| q | No | The query to search for matching song resources |
| page[size] | No | The number of song resources to display for the current page |
| page[number] | No | The page of song resources to display |
@@ -36,6 +36,7 @@ GET /api/song/
## Filters
* title
* created_at
* updated_at
* deleted_at
+2 -1
View File
@@ -21,7 +21,7 @@ GET /api/synonym/
| fields | No | Sparse fieldsets for resource types |
| include | No | Inclusion of related resources |
| filter | No | Filters for synonym resources & constraining the inclusion of related resources |
| sort | No | The list of fields to sort the resources. |
| sort | No | The list of fields to sort the resources |
| q | No | The query to search for matching synonym resources |
| page[size] | No | The number of synonym resources to display for the current page |
| page[number] | No | The page of synonym resources to display |
@@ -37,6 +37,7 @@ GET /api/synonym/
## Filters
* text
* created_at
* updated_at
* deleted_at
+2 -1
View File
@@ -21,7 +21,7 @@ GET /api/theme/
| fields | No | Sparse fieldsets for resource types |
| include | No | Inclusion of related resources |
| filter | No | Filters for theme resources & constraining the inclusion of related resources |
| sort | No | The list of fields to sort the resources. |
| sort | No | The list of fields to sort the resources |
| q | No | The query to search for matching theme resources |
| page[size] | No | The number of theme resources to display for the current page |
| page[number] | No | The page of theme resources to display |
@@ -44,6 +44,7 @@ GET /api/theme/
* type
* sequence
* group
* slug
* created_at
* updated_at
* deleted_at
+3
View File
@@ -41,6 +41,9 @@ GET /api/transaction/
* date
* service
* description
* amount
* external_id
* created_at
* updated_at
* deleted_at
+6 -1
View File
@@ -21,7 +21,7 @@ GET /api/video/
| fields | No | Sparse fieldsets for resource types |
| include | No | Inclusion of related resources |
| filter | No | Filters for video resources & constraining the inclusion of related resources |
| sort | No | The list of fields to sort the resources. |
| sort | No | The list of fields to sort the resources |
| q | No | The query to search for matching video resources |
| page[size] | No | The number of video resources to display for the current page |
| page[number] | No | The page of video resources to display |
@@ -47,6 +47,11 @@ GET /api/video/
## Filters
* basename
* filename
* path
* size
* mimetype
* resolution
* nc
* subbed