…7.0.1, i also tested out 6.4 but i had still no luck setting it up there :(
Starting the moment an Entity has been added to the Api Platform (which works on the PHP site well) the Hydra Admin is crashing after loading.
Hey @Hugues!
Hmm, indeed! The `WriteProcessor` stuff is new in API Platform 3.2... and while its addition shouldn't have changed anything, by looking at your debugging, it seems like you're right. If you don't return anything, nothing gets serialized. Well, actually…
…$uriVariables, $context);
}
}
```
if I've not returned anything from my processor `$data` will be null in the process method of SerializeProcessor.
```php
// vendor/api-platform/core/src/State/Processor/SerializeProcessor.php
final class SerializeProcessor implements ProcessorInterface
{
// ...
public function process(mixed $data, Operation $operation, array $uriVariables…
…Hugues!
Hmm, interesting! Let's think about this. If you *don't* return something from your processor, then API Platform will ultimately serialize the `$data` argument that you passed in. In your case, unless something else is going on, the inner processor, after saving, returns…
…process method I need to return the result of the process method of the decorated class. else my POST call return an empty string.
```
#[AsDecorator('api_platform.doctrine.orm.state.persist_processor')]
class UserHashPasswordProcessor implements ProcessorInterface
{
public function __construct(private ProcessorInterface $innerProcessor, private UserPasswordHasherInterface $passwordHasher)
{
…
…but yes, I believe in the latest version of API Platform you can override this - see https://github.com/api-platform/core/pull/5732
However, I've never done this - so I'm passing along the hint but I'm not sure if this is…
I am still having one little issue with that approach, The response is fine, but how do I tell API-Platform to show the correct Schema? I want to show the same Schema, that is auto-generated with every GetCollection() endpoint, so like this:
[image…
…an app from 2.6 to 3 right now, I was wondering about a behavior of the serializer that I ovserved.
In API-Platform >= 3, the default setting in the api_platform.yaml is:
```
normalization_context:
skip_null_values: true
```
So far, so good…
…the stack trace? It might be from this line - https://github.com/api-platform/core/blob/main/src/Symfony/EventListener/WriteListener.php#L116 - but I can't specifically find the `get_class()` in the code that follows.
If my guess is correct, the thing to…
…Thank you very much. Might be good to add that to the course or even to the Api Platform docs. I know a lot of people who implemented the version from the Api Platform 2 Course on production, because that way of auto generation groups…
…work for me, because when I add
`stateOptions: new Options(entityClass: SomeClass::class)`,
api platform serialization listener sets force_resource_class context parameter to operation's class value and it would be dto for writing. Then I'm getting a serialization error, saying something like…
…be passed to them, they would receive your service. But in reality, everyone asks for `api_platform.doctrine.orm.state.persist_processor`... which remains the original, core service.
Thanks for mentioning this - I wanted people to be aware of the new, shorter way of referencing…
…that! Yes, that is kind of a silent dependency - I forget about it too! If you install the api-platform/api-pack - https://github.com/api-platform/api-pack - that includes the `symfony/serializer-pack`... and THAT includes this package. If you are missing it…
…API Platform 3 :
- a jwt token for the users: this is a 'user specific' token. A user gets a jwt token from the server after successful authentication with his email and password.
- an 'api token' that would be used by some cron jobs. This api…
…But if you're starting with a new project, a recent recipe change included the `standard_put: true` in `config/packages/api_platform.yaml`, which is why you see different behavior than I have in the tutorial up to this point.
I'll add a…
…that right now. But API Platform does have docs and official support for Elastic Search - https://api-platform.com/docs/core/elasticsearch/ - and especially in episode 3 - https://symfonycasts.com/screencast/api-platform-extending - we go deeper into understanding how state providers work, which would…
…deal much with directly. But, I can give you some guidance :).
API Platform does have some docs on this - https://api-platform.com/docs/core/file-upload/ - though I'm not sure how much I like the solution. VichUploaderBundle is magic, so both good and…
…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…
x
1000+