-
-
Notifications
You must be signed in to change notification settings - Fork 911
Add configuration to define two identifier but with OR condition #2324
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
Comments
#2126 maybe? |
@soyuka Not sure. Here is a concrete case: class Server
{
/**
* @var int
*
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @Groups("gets")
*/
private $id;
/**
* @var string
*
* @ORM\Column(type="string", length=64, unique=true)
* @Groups({"gets", "post:admin"})
* @ApiFilter(SearchFilter::class, strategy="partial")
*/
private $name = '';
} I would like APIP to search on
If your PR is resolving this need, so yeah it can close this issue. 👍 |
I figured out better and I have to be 👎 because this is not good practice, an identifier should be unique. In this case I'd only use the |
Maybe. But customer needs do not always fit the best practices. Both are needed here. I can understand if you won't make it native, I will be okay with my custom data provider then. 👍 |
This is a common case when you generate slugs for resources.. But I've solved this with another solution without need to create data provider:
|
You could also avoid the slug query here by using the identifier denormalizer + #2323 (comment) |
Thanks, will check it. |
Also -1 here for the same reasons. |
For example, add the possibility to add identifiers to
$id
and$name
properties, but not consider them as composite identifier.In that case, APIP will look at the
$id
first, then$name
.Related to #2323 debate.
The text was updated successfully, but these errors were encountered: