Skip to content

Commit f88c932

Browse files
tests: check for new response schema in ContentHandler tests
1 parent 70e2a09 commit f88c932

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APICoreContentHandlerTestCase.inc

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,17 @@ class APICoreContentHandlerTestCase extends TestCase {
136136
'data' => [
137137
'type' => 'array',
138138
'items' => [
139-
'$ref' => "#/components/schemas/{$endpoint->model->get_class_shortname()}",
139+
'allOf' => [
140+
[
141+
'type' => 'object',
142+
'properties' => [
143+
'id' => ['type' => $endpoint->model->id_type],
144+
],
145+
],
146+
[
147+
'$ref' => "#/components/schemas/{$endpoint->model->get_class_shortname()}",
148+
],
149+
],
140150
],
141151
],
142152
],
@@ -165,7 +175,17 @@ class APICoreContentHandlerTestCase extends TestCase {
165175
[
166176
'type' => 'object',
167177
'properties' => [
168-
'data' => ['$ref' => "#/components/schemas/{$endpoint->model->get_class_shortname()}"],
178+
'data' => [
179+
'allOf' => [
180+
[
181+
'type' => 'object',
182+
'properties' => [
183+
'id' => ['type' => $endpoint->model->id_type],
184+
],
185+
],
186+
['$ref' => "#/components/schemas/{$endpoint->model->get_class_shortname()}"],
187+
],
188+
],
169189
],
170190
],
171191
],

0 commit comments

Comments
 (0)