mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-11-14 00:07:00 +01:00
1836 lines
26 KiB
JSON
1836 lines
26 KiB
JSON
[
|
||
{
|
||
"kind": "repos",
|
||
"query": {},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": "",
|
||
"limit": ""
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": "0",
|
||
"limit": "0"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": "-1",
|
||
"limit": "-1"
|
||
},
|
||
"expected": {
|
||
"page": -1,
|
||
"limit": -1,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": "-20suffix",
|
||
"limit": "-20suffix"
|
||
},
|
||
"expected": {
|
||
"page": -20,
|
||
"limit": -20,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": "-0x10",
|
||
"limit": "-0x10"
|
||
},
|
||
"expected": {
|
||
"page": -16,
|
||
"limit": -16,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": "2",
|
||
"limit": "2"
|
||
},
|
||
"expected": {
|
||
"page": 2,
|
||
"limit": 2,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": "2.9",
|
||
"limit": "2.9"
|
||
},
|
||
"expected": {
|
||
"page": 2,
|
||
"limit": 2,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": "2e3",
|
||
"limit": "2e3"
|
||
},
|
||
"expected": {
|
||
"page": 2,
|
||
"limit": 2,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": "+12suffix",
|
||
"limit": "+12suffix"
|
||
},
|
||
"expected": {
|
||
"page": 12,
|
||
"limit": 12,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": " 17 ",
|
||
"limit": " 17 "
|
||
},
|
||
"expected": {
|
||
"page": 17,
|
||
"limit": 17,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": "0x10",
|
||
"limit": "0x10"
|
||
},
|
||
"expected": {
|
||
"page": 16,
|
||
"limit": 16,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": "0Xff",
|
||
"limit": "0Xff"
|
||
},
|
||
"expected": {
|
||
"page": 255,
|
||
"limit": 255,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": "0b10",
|
||
"limit": "0b10"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": "0007",
|
||
"limit": "0007"
|
||
},
|
||
"expected": {
|
||
"page": 7,
|
||
"limit": 7,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": "0xg",
|
||
"limit": "0xg"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": "junk",
|
||
"limit": "junk"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": "12",
|
||
"limit": "12"
|
||
},
|
||
"expected": {
|
||
"page": 12,
|
||
"limit": 12,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": "
12",
|
||
"limit": "
12"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": "10000",
|
||
"limit": "10000"
|
||
},
|
||
"expected": {
|
||
"page": 10000,
|
||
"limit": 1000,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": "999999999999999999999999999999",
|
||
"limit": "999999999999999999999999999999"
|
||
},
|
||
"expected": {
|
||
"page": 1e+30,
|
||
"limit": 1000,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"sort": "_id",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"sort": "repoId",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"repoId": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"sort": "size.storage",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"size.storage": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"sort": "status",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"status": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"sort": "$where",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"sort": "a b",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"sort": "a/b",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"sort": "a;drop",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"sort": "status\n",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"sort": "status\r\n",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"sort": "",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"sort": [
|
||
"status",
|
||
"_id"
|
||
],
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"sort": "status",
|
||
"direction": [
|
||
"asc",
|
||
"desc"
|
||
]
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"status": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"sort": "status",
|
||
"direction": "ASC"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"status": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"query": {
|
||
"page": [
|
||
"3",
|
||
"4"
|
||
],
|
||
"limit": [
|
||
"2",
|
||
"3"
|
||
]
|
||
},
|
||
"expected": {
|
||
"page": 3,
|
||
"limit": 2,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"rawQuery": "page[]=3&limit[]=2",
|
||
"expected": {
|
||
"page": 3,
|
||
"limit": 2,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"rawQuery": "page[1]=3&page[0]=2",
|
||
"expected": {
|
||
"page": 2,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"rawQuery": "page[x]=2",
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"rawQuery": "page[toString]=x",
|
||
"error": true
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"rawQuery": "limit[toString]=x",
|
||
"error": true
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"rawQuery": "sort[]=status&direction[]=asc",
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"rawQuery": "sort=status&sort[x]=foo",
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"rawQuery": "format[]=csv",
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"rawQuery": "format=csv",
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "repos",
|
||
"rawQuery": "direction=asc&direction=desc",
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": "",
|
||
"limit": ""
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": "0",
|
||
"limit": "0"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": "-1",
|
||
"limit": "-1"
|
||
},
|
||
"expected": {
|
||
"page": -1,
|
||
"limit": -1,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": "-20suffix",
|
||
"limit": "-20suffix"
|
||
},
|
||
"expected": {
|
||
"page": -20,
|
||
"limit": -20,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": "-0x10",
|
||
"limit": "-0x10"
|
||
},
|
||
"expected": {
|
||
"page": -16,
|
||
"limit": -16,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": "2",
|
||
"limit": "2"
|
||
},
|
||
"expected": {
|
||
"page": 2,
|
||
"limit": 2,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": "2.9",
|
||
"limit": "2.9"
|
||
},
|
||
"expected": {
|
||
"page": 2,
|
||
"limit": 2,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": "2e3",
|
||
"limit": "2e3"
|
||
},
|
||
"expected": {
|
||
"page": 2,
|
||
"limit": 2,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": "+12suffix",
|
||
"limit": "+12suffix"
|
||
},
|
||
"expected": {
|
||
"page": 12,
|
||
"limit": 12,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": " 17 ",
|
||
"limit": " 17 "
|
||
},
|
||
"expected": {
|
||
"page": 17,
|
||
"limit": 17,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": "0x10",
|
||
"limit": "0x10"
|
||
},
|
||
"expected": {
|
||
"page": 16,
|
||
"limit": 16,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": "0Xff",
|
||
"limit": "0Xff"
|
||
},
|
||
"expected": {
|
||
"page": 255,
|
||
"limit": 255,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": "0b10",
|
||
"limit": "0b10"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": "0007",
|
||
"limit": "0007"
|
||
},
|
||
"expected": {
|
||
"page": 7,
|
||
"limit": 7,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": "0xg",
|
||
"limit": "0xg"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": "junk",
|
||
"limit": "junk"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": "12",
|
||
"limit": "12"
|
||
},
|
||
"expected": {
|
||
"page": 12,
|
||
"limit": 12,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": "
12",
|
||
"limit": "
12"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": "10000",
|
||
"limit": "10000"
|
||
},
|
||
"expected": {
|
||
"page": 10000,
|
||
"limit": 1000,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": "999999999999999999999999999999",
|
||
"limit": "999999999999999999999999999999"
|
||
},
|
||
"expected": {
|
||
"page": 1e+30,
|
||
"limit": 1000,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"sort": "_id",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"sort": "repoId",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"repoId": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"sort": "size.storage",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"size.storage": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"sort": "status",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"status": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"sort": "$where",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"sort": "a b",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"sort": "a/b",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"sort": "a;drop",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"sort": "status\n",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"sort": "status\r\n",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"sort": "",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"sort": [
|
||
"status",
|
||
"_id"
|
||
],
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"sort": "status",
|
||
"direction": [
|
||
"asc",
|
||
"desc"
|
||
]
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"status": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"sort": "status",
|
||
"direction": "ASC"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"status": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"query": {
|
||
"page": [
|
||
"3",
|
||
"4"
|
||
],
|
||
"limit": [
|
||
"2",
|
||
"3"
|
||
]
|
||
},
|
||
"expected": {
|
||
"page": 3,
|
||
"limit": 2,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"rawQuery": "page[]=3&limit[]=2",
|
||
"expected": {
|
||
"page": 3,
|
||
"limit": 2,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"rawQuery": "page[1]=3&page[0]=2",
|
||
"expected": {
|
||
"page": 2,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"rawQuery": "page[x]=2",
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"rawQuery": "page[toString]=x",
|
||
"error": true
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"rawQuery": "limit[toString]=x",
|
||
"error": true
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"rawQuery": "sort[]=status&direction[]=asc",
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"rawQuery": "sort=status&sort[x]=foo",
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"rawQuery": "format[]=csv",
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"rawQuery": "format=csv",
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "users",
|
||
"rawQuery": "direction=asc&direction=desc",
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": "",
|
||
"limit": ""
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": "0",
|
||
"limit": "0"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": "-1",
|
||
"limit": "-1"
|
||
},
|
||
"expected": {
|
||
"page": -1,
|
||
"limit": -1,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": "-20suffix",
|
||
"limit": "-20suffix"
|
||
},
|
||
"expected": {
|
||
"page": -20,
|
||
"limit": -20,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": "-0x10",
|
||
"limit": "-0x10"
|
||
},
|
||
"expected": {
|
||
"page": -16,
|
||
"limit": -16,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": "2",
|
||
"limit": "2"
|
||
},
|
||
"expected": {
|
||
"page": 2,
|
||
"limit": 2,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": "2.9",
|
||
"limit": "2.9"
|
||
},
|
||
"expected": {
|
||
"page": 2,
|
||
"limit": 2,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": "2e3",
|
||
"limit": "2e3"
|
||
},
|
||
"expected": {
|
||
"page": 2,
|
||
"limit": 2,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": "+12suffix",
|
||
"limit": "+12suffix"
|
||
},
|
||
"expected": {
|
||
"page": 12,
|
||
"limit": 12,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": " 17 ",
|
||
"limit": " 17 "
|
||
},
|
||
"expected": {
|
||
"page": 17,
|
||
"limit": 17,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": "0x10",
|
||
"limit": "0x10"
|
||
},
|
||
"expected": {
|
||
"page": 16,
|
||
"limit": 16,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": "0Xff",
|
||
"limit": "0Xff"
|
||
},
|
||
"expected": {
|
||
"page": 255,
|
||
"limit": 255,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": "0b10",
|
||
"limit": "0b10"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": "0007",
|
||
"limit": "0007"
|
||
},
|
||
"expected": {
|
||
"page": 7,
|
||
"limit": 7,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": "0xg",
|
||
"limit": "0xg"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": "junk",
|
||
"limit": "junk"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": "12",
|
||
"limit": "12"
|
||
},
|
||
"expected": {
|
||
"page": 12,
|
||
"limit": 12,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": "
12",
|
||
"limit": "
12"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": "10000",
|
||
"limit": "10000"
|
||
},
|
||
"expected": {
|
||
"page": 10000,
|
||
"limit": 1000,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": "999999999999999999999999999999",
|
||
"limit": "999999999999999999999999999999"
|
||
},
|
||
"expected": {
|
||
"page": 1e+30,
|
||
"limit": 1000,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"sort": "_id",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"sort": "repoId",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"repoId": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"sort": "size.storage",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"size.storage": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"sort": "status",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"status": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"sort": "$where",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"sort": "a b",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"sort": "a/b",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"sort": "a;drop",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"sort": "status\n",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"sort": "status\r\n",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"sort": "",
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"sort": [
|
||
"status",
|
||
"_id"
|
||
],
|
||
"direction": "asc"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": 1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"sort": "status",
|
||
"direction": [
|
||
"asc",
|
||
"desc"
|
||
]
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"status": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"sort": "status",
|
||
"direction": "ASC"
|
||
},
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"status": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"query": {
|
||
"page": [
|
||
"3",
|
||
"4"
|
||
],
|
||
"limit": [
|
||
"2",
|
||
"3"
|
||
]
|
||
},
|
||
"expected": {
|
||
"page": 3,
|
||
"limit": 2,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"rawQuery": "page[]=3&limit[]=2",
|
||
"expected": {
|
||
"page": 3,
|
||
"limit": 2,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"rawQuery": "page[1]=3&page[0]=2",
|
||
"expected": {
|
||
"page": 2,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"rawQuery": "page[x]=2",
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"rawQuery": "page[toString]=x",
|
||
"error": true
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"rawQuery": "limit[toString]=x",
|
||
"error": true
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"rawQuery": "sort[]=status&direction[]=asc",
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"rawQuery": "sort=status&sort[x]=foo",
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"rawQuery": "format[]=csv",
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"rawQuery": "format=csv",
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"kind": "conferences",
|
||
"rawQuery": "direction=asc&direction=desc",
|
||
"expected": {
|
||
"page": 1,
|
||
"limit": 10,
|
||
"sort": {
|
||
"_id": -1
|
||
}
|
||
}
|
||
}
|
||
]
|