Skip to content
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

Support short UUID in Ramsey bridge #2191

Closed
dkarlovi opened this issue Sep 6, 2018 · 6 comments
Closed

Support short UUID in Ramsey bridge #2191

dkarlovi opened this issue Sep 6, 2018 · 6 comments

Comments

@dkarlovi
Copy link
Contributor

dkarlovi commented Sep 6, 2018

We could add rudimentary support in the Ramsey UUID normalizer for the short UUID variant: https://packagist.org/packages/pascaldevink/shortuuid

@soyuka
Copy link
Member

soyuka commented Sep 7, 2018

It's really easy to add this in one's own project no? Not sure we need to add this to core. That said, if you read this please add 👍 on the issue if there's enough people we may consider it :).

@ParmentierChristophe
Copy link

we can't implement this, because this test not working :

    public function testFailDenormalizeUuid()
    {
        $this->expectException(\ApiPlatform\Core\Exception\InvalidIdentifierException::class);

        $uuid = 'notanuuid';
        $normalizer = new ShortUuidNormalizer();
        $this->assertTrue($normalizer->supportsDenormalization($uuid, ShortUuid::class));
        $normalizer->denormalize($uuid, ShortUuid::class);
   
    }

@soyuka
Copy link
Member

soyuka commented Oct 6, 2018

see pascaldevink/shortuuid#29

@thib92
Copy link

thib92 commented Oct 1, 2019

Would love to take that one. Any idea how this should be configured? I'm guessing it should be an opt-in configuration option?

@soyuka
Copy link
Member

soyuka commented Oct 1, 2019

We can't implement this yet because an invalid uuid doesn't throw on the upstream library. see related links, mb you can try to patch there first

@thib92
Copy link

thib92 commented Oct 1, 2019

Oh good to know, I'll see what I can do. Thanks @soyuka

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants