@@ -20,37 +20,62 @@ Feature: Search filter on collections
20
20
When I send a "GET" request to "/dummy_cars?colors.prop=red"
21
21
Then the response status code should be 200
22
22
And the JSON should be deep equal to:
23
- """
23
+ """
24
24
{
25
- "@context": "/contexts/DummyCar",
26
- "@id": "/dummy_cars",
27
- "@type": "hydra:Collection",
28
- "hydra:member": [
25
+ "@context": "/contexts/DummyCar",
26
+ "@id": "/dummy_cars",
27
+ "@type": "hydra:Collection",
28
+ "hydra:member": [
29
+ {
30
+ "@id": "/dummy_cars/1",
31
+ "@type": "DummyCar",
32
+ "colors": [
29
33
{
30
- "@id": "/dummy_cars/1",
31
- "@type": "DummyCar",
32
- "colors": [
33
- {
34
- "@id": "/dummy_car_colors/1",
35
- "@type": "DummyCarColor",
36
- "prop": "red"
37
- },
38
- {
39
- "@id": "/dummy_car_colors/2",
40
- "@type": "DummyCarColor",
41
- "prop": "blue"
42
- }
43
- ]
34
+ "@id": "/dummy_car_colors/1",
35
+ "@type": "DummyCarColor",
36
+ "prop": "red"
37
+ },
38
+ {
39
+ "@id": "/dummy_car_colors/2",
40
+ "@type": "DummyCarColor",
41
+ "prop": "blue"
44
42
}
45
- ],
46
- "hydra:totalItems": 1,
47
- "hydra:view": {
48
- "@id": "/dummy_cars?colors.prop=red",
49
- "@type": "hydra:PartialCollectionView"
50
- },
51
- "hydra:search": {
43
+ ],
44
+ "secondColors": [
45
+ {
46
+ "@id": "/dummy_car_colors/1",
47
+ "@type": "DummyCarColor",
48
+ "prop": "red"
49
+ },
50
+ {
51
+ "@id": "/dummy_car_colors/2",
52
+ "@type": "DummyCarColor",
53
+ "prop": "blue"
54
+ }
55
+ ],
56
+ "thirdColors": [
57
+ {
58
+ "@id": "/dummy_car_colors/1",
59
+ "@type": "DummyCarColor",
60
+ "prop": "red"
61
+ },
62
+ {
63
+ "@id": "/dummy_car_colors/2",
64
+ "@type": "DummyCarColor",
65
+ "prop": "blue"
66
+ }
67
+ ],
68
+ "uuid": []
69
+ }
70
+ ],
71
+ "hydra:totalItems": 1,
72
+ "hydra:view": {
73
+ "@id": "/dummy_cars?colors.prop=red",
74
+ "@type": "hydra:PartialCollectionView"
75
+ },
76
+ "hydra:search": {
52
77
"@type": "hydra:IriTemplate",
53
- "hydra:template": "\ /dummy_cars{?availableAt[before],availableAt[strictly_before],availableAt[after],availableAt[strictly_after],canSell,foobar[],foobargroups[],foobargroups_override[],colors.prop,name}",
78
+ "hydra:template": "/dummy_cars{?availableAt[before],availableAt[strictly_before],availableAt[after],availableAt[strictly_after],canSell,foobar[],foobargroups[],foobargroups_override[],colors.prop,colors,colors[],secondColors,secondColors[],thirdColors,thirdColors[],uuid,uuid[] ,name}",
54
79
"hydra:variableRepresentation": "BasicRepresentation",
55
80
"hydra:mapping": [
56
81
{
@@ -83,12 +108,24 @@ Feature: Search filter on collections
83
108
"property": "canSell",
84
109
"required": false
85
110
},
111
+ {
112
+ "@type": "IriTemplateMapping",
113
+ "variable": "colors",
114
+ "property": "colors",
115
+ "required": false
116
+ },
86
117
{
87
118
"@type": "IriTemplateMapping",
88
119
"variable": "colors.prop",
89
120
"property": "colors.prop",
90
121
"required": false
91
122
},
123
+ {
124
+ "@type": "IriTemplateMapping",
125
+ "variable": "colors[]",
126
+ "property": "colors",
127
+ "required": false
128
+ },
92
129
{
93
130
"@type": "IriTemplateMapping",
94
131
"variable": "foobar[]",
@@ -112,6 +149,42 @@ Feature: Search filter on collections
112
149
"variable": "name",
113
150
"property": "name",
114
151
"required": false
152
+ },
153
+ {
154
+ "@type": "IriTemplateMapping",
155
+ "variable": "secondColors",
156
+ "property": "secondColors",
157
+ "required": false
158
+ },
159
+ {
160
+ "@type": "IriTemplateMapping",
161
+ "variable": "secondColors[]",
162
+ "property": "secondColors",
163
+ "required": false
164
+ },
165
+ {
166
+ "@type": "IriTemplateMapping",
167
+ "variable": "thirdColors",
168
+ "property": "thirdColors",
169
+ "required": false
170
+ },
171
+ {
172
+ "@type": "IriTemplateMapping",
173
+ "variable": "thirdColors[]",
174
+ "property": "thirdColors",
175
+ "required": false
176
+ },
177
+ {
178
+ "@type": "IriTemplateMapping",
179
+ "variable": "uuid",
180
+ "property": "uuid",
181
+ "required": false
182
+ },
183
+ {
184
+ "@type": "IriTemplateMapping",
185
+ "variable": "uuid[]",
186
+ "property": "uuid",
187
+ "required": false
115
188
}
116
189
]
117
190
}
@@ -389,8 +462,7 @@ Feature: Search filter on collections
389
462
"@id": {"pattern": "^/dummies$"},
390
463
"@type": {"pattern": "^hydra:Collection$"},
391
464
"hydra:member": {
392
- "type": "array",
393
- "maxItems": 0
465
+ "type": "array"
394
466
},
395
467
"hydra:view": {
396
468
"type": "object",
@@ -655,3 +727,4 @@ Feature: Search filter on collections
655
727
}
656
728
}
657
729
"""
730
+
0 commit comments