Skip to content

Commit c4623c3

Browse files
weaverryanantograssiot
authored andcommitted
swagger/openapi bug with PropertyFilter use ?properties[]= not ?properties= (#2783)
* Fixing swagger/openapi bug: use ?properties[]= not ?properties=
1 parent 0de0b75 commit c4623c3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Serializer/Filter/PropertyFilter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ public function getDescription(string $resourceClass): array
7979
'required' => false,
8080
'swagger' => [
8181
'description' => 'Allows you to reduce the response to contain only the properties you need. If your desired property is nested, you can address it using nested arrays. Example: '.$example,
82-
'name' => $this->parameterName,
82+
'name' => "$this->parameterName[]",
8383
'type' => 'array',
8484
'items' => [
8585
'type' => 'string',
8686
],
8787
],
8888
'openapi' => [
8989
'description' => 'Allows you to reduce the response to contain only the properties you need. If your desired property is nested, you can address it using nested arrays. Example: '.$example,
90-
'name' => $this->parameterName,
90+
'name' => "$this->parameterName[]",
9191
'schema' => [
9292
'type' => 'array',
9393
'items' => [

tests/Serializer/Filter/PropertyFilterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@ public function testGetDescription()
132132
'required' => false,
133133
'swagger' => [
134134
'description' => 'Allows you to reduce the response to contain only the properties you need. If your desired property is nested, you can address it using nested arrays. Example: custom_properties[]={propertyName}&custom_properties[]={anotherPropertyName}&custom_properties[{nestedPropertyParent}][]={nestedProperty}',
135-
'name' => 'custom_properties',
135+
'name' => 'custom_properties[]',
136136
'type' => 'array',
137137
'items' => [
138138
'type' => 'string',
139139
],
140140
],
141141
'openapi' => [
142142
'description' => 'Allows you to reduce the response to contain only the properties you need. If your desired property is nested, you can address it using nested arrays. Example: custom_properties[]={propertyName}&custom_properties[]={anotherPropertyName}&custom_properties[{nestedPropertyParent}][]={nestedProperty}',
143-
'name' => 'custom_properties',
143+
'name' => 'custom_properties[]',
144144
'schema' => [
145145
'type' => 'array',
146146
'items' => [

0 commit comments

Comments
 (0)