-
-
Notifications
You must be signed in to change notification settings - Fork 913
fix(Pagination): Fix UUID in range filter #4595
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
Closed
Closed
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ffa5a7e
Fix UUID in range
KDederichs 88018a0
Fix CS
KDederichs 503884b
Don't use Symfony UID since 7.1 is required
KDederichs 4525014
Don't depend on 3rd party for Uid check.
KDederichs 187602a
Change exception message.
KDederichs 5d21f46
Check and coerce if numeric
KDederichs df080de
CS Fix
KDederichs d9ebdf2
Skip test if class doesn't exist
KDederichs ff633e9
CS
KDederichs 5ceb73c
Revert "Skip test if class doesn't exist"
KDederichs 688ca23
Skip via Tags
KDederichs c7e044c
Behat lowest also can not run uid tests
KDederichs b68bc06
Merge branch 'main' into pagination_fix
KDederichs 93f67c6
Add SoManyUids to Document tests
KDederichs 0d78705
import correct filters
KDederichs acaff93
Fix Doctrine context
KDederichs 4b1f276
Method is not called isOdm :)
KDederichs 7678169
ODM requires strategy NONE
KDederichs a0d1a58
Turns out, there's no mapping for those, so exclude them in MongoDB r…
KDederichs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the API Platform project. | ||
* | ||
* (c) Kévin Dunglas <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ApiPlatform\Tests\Fixtures\TestBundle\Entity; | ||
|
||
use ApiPlatform\Core\Annotation\ApiFilter; | ||
use ApiPlatform\Core\Annotation\ApiResource; | ||
use ApiPlatform\Doctrine\Orm\Filter\OrderFilter; | ||
use ApiPlatform\Doctrine\Orm\Filter\RangeFilter; | ||
use Doctrine\ORM\Mapping as ORM; | ||
use Ramsey\Uuid\Nonstandard\UuidV6; | ||
|
||
/** | ||
* @ORM\Entity | ||
* @ApiResource(attributes={ | ||
* "pagination_partial"=true, | ||
* "pagination_via_cursor"={ | ||
* {"field"="id", "direction"="DESC"} | ||
* } | ||
* }) | ||
* | ||
* @ApiFilter(RangeFilter::class, properties={"id"}) | ||
* @ApiFilter(OrderFilter::class, properties={"id"="DESC"}) | ||
*/ | ||
class SoManyUids | ||
{ | ||
/** | ||
* @ORM\Id | ||
* @ORM\Column(type="uuid") | ||
*/ | ||
public $id; | ||
|
||
/** | ||
* @ORM\Column(nullable=true) | ||
*/ | ||
public $content; | ||
|
||
public function __construct($id) | ||
{ | ||
if ($id) { | ||
$this->id = UuidV6::fromString($id); | ||
} else { | ||
$this->id = UuidV6::uuid6(); | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.