…you are returning a response object with everything serialized with default Symfony serializer, try to return a collection of objects `$list` variable
BTW https://api-platform.com/docs/core/pagination/#custom-controller-action here you can check ApiPlatform example on custom collection with pagination
Cheers!
…that's unexpected. Have you watched this chapter? You may find it helpful https://symfonycasts.com/screencast/api-platform-extending/uuid-identifier
By the way, I don't recommend using UUIDs as the primary key because it will slow down your queries. It's better…
Hey |mention:77199|
I'm afraid it's not compatible. In their `composer.json` I see they require Symfony 6 components https://github.com/api-platform/core/blob/main/composer.json
But, I may be wrong, the best way to know is by giving it…
Great lessons, thanks! Is there a video on how to use GraphQl based on Api-Platform?
Hey @Sebastian-K!
Hmm, interesting! Subresources are cool - and are MUCH nicer than in API Platform 2 (they were kind of a hacked addon the, but they're a first-class citizen now). And so, we can definitely use them. But we also may not…
i think you put the coding-challenge before this chapter by mistake.
btw. Ryan ... my cats missing the cat-lang of the courses. they still stuck on Api-Platform 2.6.
Hey @Oleh-K!
Sorry for the slow reply! Hmm. I wonder: did you add the `access_token` config to `api_platform.yaml`? I actually think your solution is superior. My guess (I could be wrong) is that you don't have this config. And so…
…as `api_platform` config loaded during a compile time. So it is has not picked up ENV variables, and next configuration does not work:
```
api_platform:
enable_swagger: '%env(bool:ENABLE_API_DOCS)%'
# .... and other disablings
```
My current sollution, is:
```
when@prod:
api_platform:
enable…
Hey |mention:37028|
I believe you're decorating the wrong service, this is the service you should decorate `api_platform.jsonld.normalizer.item`
Cheers!
Hello!
Thanks, but It does not solve the problem.
However I've set a solution, for anybody who need it https://github.com/api-platform/core/issues/4672#issuecomment-1557480806.
…all of us struggling with an empty spec "No operations defined in spec!" using php 8 attributes, there's a compatibility layer that needs to be disabled:
```
api_platform:
metadata_backward_compatibility_layer: false
```
Source: https://github.com/api-platform/core/issues/4485#issuecomment-933448396
…was maybe the ONE thing I didn't include in the API Platform 3 tutorial and at least 2 people have asked about it :P. Here is the other conversation - https://symfonycasts.com/screencast/api-platform/install#comment-29468 - it looks like the feature should…
… Sounds promising. And your use-case makes a lot of sense. This is one of those features where it feels like they probably shouldn't add something so automatic to the core of API Platform... but for certain projects, users can really leverage it.
Good…
…I decided not to cover this for the API Platform 3 tutorial. I just wasn't sure how many people were actually using it. But I can also say that, afaik, there is nothing that makes this now a "bad idea" in API Platform 3…
…API Platform 2, the creation of a Resource Metadata Factory was discussed. Since it is a very convenient way to create Metadata for inheritance structures (Bleu de Gex *extends* Blue Cheese *extends* Cheese) i would like to keep it after my migration to API Platform…
…that feature. You'll have to **decorate** the `PaginationExtension` class then, or create a custom paginator. Here's an example about how to decorate an ApiPlatform service https://api-platform.com/docs/core/state-processors/#creating-a-custom-state-processor
I hope it helps. Cheers!
Hey @Tobias-B!
Your thinking on this is absolutely correct. For me, it was a trade-off between complexity (the API Platform official way is more complex) vs potential performance problems. So, the final decision is subjective, but since `PersistProcessor` is only called during POST…
…
Hmm. Did you create an access token authenticator like we did? https://symfonycasts.com/screencast/api-platform-security/access-token-authenticator
If so, here is what I would do to debug:
A) After making the AJAX request to "log in", find the Symfony profiler for…
…call of the PersistProcessor?
In the API Platform docs they use a "bind" in the services to bind the $persistProcessor as an argument to the "UserPasswordHasher".
This way I guess it is only decorating the service when it is used (e.g. defining the "processor…
…way to go.
https://github.com/api-platform/core/issues/5451
```
api_platform:
mapping:
paths: ['%kernel.project_dir%/config/api_platform', '%kernel.project_dir%/src/Dto']
```
```
resources:
App\DomainBundle\Entity\AdminUser:
normalizationContext:
groups: [ 'admin-user:read' ]
denormalizationContext:
groups: [ 'admin-user:write' ]
operations:
ApiPlatform\Metadata\GetCollection:
…
x
1000+