... Hi, I'm using api-platform configuration with yaml and not with annotations, also the serializer, so, I'm struggling to get a getProperty() to work with groups, like your example of getCreatedAtAgo(), but, in my case, I ...
It was really difficult to come up with a working example because the documentation is not very clear on this issue and I am not that good with api platform yet so..., weaverryan what do you think of this solution? Do you have any suggestion? I hope this help someone!! Cheers!!! ...
Hi weaverryan! Yes, indeed, I am using the new authentication manager. I completely missed this incompatibility issue with it. After upgrading to the 2.6.0-beta.1 version of api-platform/core all tests are passing and I get lovely 401 error messages. Awesome! Thank you! ...
... something (sort of) similar here - https://symfonycasts.com/screencast/api-platform-security/auto-groups
I hope that helps! Cheers!
My voters use constants for their roles.
`const EDIT_POST = 'EDIT_POST';`
Is there anyway to use these inside the annotation the same way we would do in a controller?
I've been trying a couple of things, but nothing worked so far.
Using Symfony 5.2.1 with PHP 7.4 and API Platform 2.5.9 ...
Hey Carlos!
In 2020/2021, I am using Symfony's native testing tools (also, if you use API Platform, they have some nice add-ons onto the testing tools). Behat is really interesting, but I think, for most people, it's probably a bit overkill for API's. So, use PHPUnit with whatever "test client" your framework gives you :).
Cheers! ...
Hola Cesar C.
Entre este curso y el mas reciente de ApiPlatform (https://symfonycasts.com/screencast/api-platform-extending ) puedes encontrar casi todas esas tecnologias, solo hace falta Auth2.0 pero gracias por la sugerencia, las tomamos en serio para decidir que cursos desarrollar primero.
Saludos! ...
Hey Rafal,
Hm, interesting... in the latest version of ApiPlatform I see that $context is optional, see https://github.com/api-platform/core/blob/v2.5.7/src/DataProvider/Pagination.php#L169 . Probably it's required in ...
Sorry, but if I don't want just to hide the uncaught exceptions inside a logger?For example it could be thrown an AccessDeniedHttpException which would not be catched by API platform. What should I do in this situation?How I can handle it? ...
So if I see this right zenstruck/foundry acts as a replacement for the hautelook/AliceBundle dependency which is currently incompatible with api-platform 2.5.7? And is there a reason why zenstruck/foundry and the doctrine-fixtures-bundle isn't just a require-dev dependency? ...
Hey Guido!
Not in this tutorial - DTO's aren't really related to Doctrine - they are more important depending on *how* you want to use them - like DTO's in the form component or DTO's with API Platform. What is your interest with DTO's?
Cheers! ...
I think Hans Grinwis just nailed the answer :). If you have a "title" argument to the constructor, then it IS something you can set on CREATE, because API Platform will use your constructor. But if it has not setter, then you cannot update it. Excellent catch on that! It's a feature, but it *is* subtle. ...
... was expected.
api-platform/core v2.5.5
symfony/http-client v4.3.11
symfony/http-foundation v4.3.11
symfony/http-kernel v4.3.11
symfony/phpunit-bridge v5.0.8
... () must be an instance of App\\Entity\\User, null given, called in /Users/hannah/PhpstormProjects/api-platform-security/src/Serializer/Normalizer/UserNormalizer.php on line 104"
`
UserResourceTest::testCreateUser also fails with the same Error.
I'm confused :) ...
Hey Daniel S.
Thanks for reaching us. We are very glad that you appreciate our courses. Unfortunately I can't give you any ETA on Api platform part 3 so stay in touch and looking for updates. While waiting it I'd recommend to check out our newest Symfony 5 tutorials.
Cheers! ...
Hey ahmedbhs!
Sorry for the late reply! Yes, this should indeed be possible :). In API Platform, they use their own custom Client service (as you've noticed). But *inside* that services is the "normal" one. So, try ...
... Ohh I wasn't aware of that. Hmm, maybe this chapter can help you https://symfonycasts.com/screencast/api-platform-security/resource-metadata-factory
Ryan shows how you can modify the metadata of your endpoints, it requires some work but I think that's what you need
Cheers!
Hey man,
Good observation. Hashing the password and adding roles is a job you have to do and has nothing to do with ApiPlatform. Ryan talks more about that in the next course: https://symfonycasts.com/screencast/api ...
Hi! I have an angular frontend aplication with is hosted on other server, so there is no way to read cookies set to httpOnly: true. As far as i understand CSRF is not available then? Or I could do some configuration in API platform to anable this? Thanks in advance. ...
Hey Abdelkarim,
Yeah, more info about it: It seems access_control was replaced with security. see their changelog: https://github.com/api-platform/core/blob/master/CHANGELOG.md#250-beta-1
So, if you replace "access_control" with security in User object - it should pass :)
Cheers! ...
1026
API Platform
Filter Results