Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions features/openapi/docs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Feature: Documentation support
And the OpenAPI class "User-user_user-write" exists
And the OpenAPI class "UuidIdentifierDummy" exists
And the OpenAPI class "ThirdLevel" exists
And the OpenAPI class "DummyCar" exists
And the OpenAPI class "ParentDummy" doesn't exist
And the OpenAPI class "UnknownDummy" doesn't exist
And the OpenAPI path "/relation_embedders/{id}/custom" exists
Expand Down Expand Up @@ -112,6 +113,9 @@ Feature: Documentation support
And the JSON node "paths./dummies.get.parameters[3].required" should be false
And the JSON node "paths./dummies.get.parameters[3].schema.type" should be equal to "boolean"

And the JSON node "paths./dummy_cars.get.parameters[8].name" should be equal to "foobar[]"
And the JSON node "paths./dummy_cars.get.parameters[8].description" should be equal to "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: foobar[]={propertyName}&foobar[]={anotherPropertyName}&foobar[{nestedPropertyParent}][]={nestedProperty}"

# Subcollection - check filter on subResource
And the JSON node "paths./related_dummies/{id}/related_to_dummy_friends.get.parameters[0].name" should be equal to "id"
And the JSON node "paths./related_dummies/{id}/related_to_dummy_friends.get.parameters[0].in" should be equal to "path"
Expand Down
1 change: 1 addition & 0 deletions src/Serializer/Filter/PropertyFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public function getDescription(string $resourceClass): array
'type' => 'string',
'is_collection' => true,
'required' => false,
'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,
'swagger' => [
'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,
'name' => "$this->parameterName[]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ public function getId(): ?int
return $this->id;
}

public function getFoo(): ?bool
{
return $this->foo;
}
public function getFoo(): ?bool
{
return $this->foo;
}

public function setFoo(?bool $foo): void
{
Expand Down
1 change: 1 addition & 0 deletions tests/Serializer/Filter/PropertyFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ public function testGetDescription(): void
'type' => 'string',
'is_collection' => true,
'required' => false,
'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}',
'swagger' => [
'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}',
'name' => 'custom_properties[]',
Expand Down