-
-
Notifications
You must be signed in to change notification settings - Fork 901
feat: iri search filter #7079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: iri search filter #7079
Conversation
soyuka
commented
Apr 10, 2025
Q | A |
---|---|
Branch? | main |
Tickets | continues the work at #6865 |
License | MIT |
Doc PR | TODO |
continues the work at api-platform#6865
@@ -22,7 +22,7 @@ | |||
use Symfony\Component\Serializer\Annotation\Groups; | |||
|
|||
#[ApiResource] | |||
#[GetCollection] | |||
#[GetCollection()] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[GetCollection()] | |
#[GetCollection] |
@@ -22,7 +22,7 @@ | |||
use Symfony\Component\Serializer\Annotation\Groups; | |||
|
|||
#[ApiResource] | |||
#[GetCollection] | |||
#[GetCollection()] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[GetCollection()] | |
#[GetCollection] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these suggestions will solve the 2 PHPStan errors & some tests failures @soyuka
if (null === $parameter->getProvider() && (($f = $parameter->getFilter()) && $f instanceof ParameterProviderFilterInterface)) { | ||
$parameters->add($key, $parameter->withProvider($f->getParameterProvider())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (null === $parameter->getProvider() && (($f = $parameter->getFilter()) && $f instanceof ParameterProviderFilterInterface)) { | |
$parameters->add($key, $parameter->withProvider($f->getParameterProvider())); | |
if (null === $parameter->getProvider() && (($filter = $parameter->getFilter()) && $f instanceof ParameterProviderFilterInterface)) { | |
$parameters->add($key, $parameter->withProvider($filter->getParameterProvider())); |
class Chicken | ||
{ | ||
#[ODM\Id] | ||
private string $id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private string $id; | |
private ?string $id = null; |
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; | ||
|
||
#[ODM\Document] | ||
#[GetCollection(normalizationContext: ['hydra_prefix' => false], parameters: ['chickens' => new QueryParameter(filter: new IriFilter())])] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[GetCollection(normalizationContext: ['hydra_prefix' => false], parameters: ['chickens' => new QueryParameter(filter: new IriFilter())])] | |
#[GetCollection( | |
normalizationContext: ['hydra_prefix' => false], | |
parameters: ['chickens' => new QueryParameter(filter: new IriFilter())] | |
)] |
use Doctrine\ORM\Mapping as ORM; | ||
|
||
#[ORM\Entity] | ||
#[Get()] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[Get()] | |
#[Get] |
|
||
namespace ApiPlatform\Tests\Fixtures\TestBundle\Document; | ||
|
||
use ApiPlatform\Doctrine\Orm\Filter\IriFilter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use ApiPlatform\Doctrine\Orm\Filter\IriFilter; | |
use ApiPlatform\Doctrine\Odm\Filter\IriFilter; |
use ApiPlatform\Doctrine\Orm\Filter\IriFilter; | ||
use ApiPlatform\Metadata\GetCollection; | ||
use ApiPlatform\Metadata\QueryParameter; | ||
use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Chicken; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Chicken; | |
use ApiPlatform\Tests\Fixtures\TestBundle\Document\Chicken; |
use Doctrine\ORM\Mapping as ORM; | ||
|
||
#[ORM\Entity] | ||
#[GetCollection(normalizationContext: ['hydra_prefix' => false], parameters: ['chickens' => new QueryParameter(filter: new IriFilter())])] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[GetCollection(normalizationContext: ['hydra_prefix' => false], parameters: ['chickens' => new QueryParameter(filter: new IriFilter())])] | |
#[GetCollection( | |
normalizationContext: ['hydra_prefix' => false], | |
parameters: ['chickens' => new QueryParameter(filter: new IriFilter())] | |
)] |