question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Item Operations "Not Found" error

See original GitHub issue

I am having issues with my item operations for my endpoints. I am assuming it’s not picking up the {id} in the path.

resources.yaml

App\Entity\Agent:
    collectionOperations:
        post:
            method: 'POST'
            path: '/agent'
            validation_groups: ['Default','postValidation']
            controller: 'App\Controller\CreateAgent'
    itemOperations:
        put:
            method: 'PUT'
            path: '/agent/{id}/update'
            validation_groups: ['Default']
            controller: 'App\Controller\UpdateAgent'
        get:
            method: 'GET'
            path: '/agent/{id}/client-information'
            controller: 'App\Controller\GetClientInformation'
            normalization_context:
                groups: ['clientInformationResults']

controller for one of the endpoints:

namespace App\Controller;


use App\Entity\Agent;

class GetClientInformation
{
    /**
     * @param Agent $data
     * @return Agent
     */
    public function __invoke(Agent $data): Agent
    {
        return $data;
    }
}

Error

@context": "/contexts/Error",
    "@type": "hydra:Error",
    "hydra:title": "An error occurred",
    "hydra:description": "Not Found",
    "trace": [
        {
            "namespace": "",
            "short_class": "",
            "class": "",
            "type": "",
            "function": "",
            "file": "/app/vendor/api-platform/core/src/EventListener/ReadListener.php",
            "line": 107,
            "args": []
        },
        ...........

I am assuming I am missing something in my configs but I can’t find any examples of this.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
abengtsoncommented, Mar 14, 2019

it does explain why I had it working with the data persister and provider, but was really hoping for some magic. Still new to symfony and api platform.

THanks for the help!

1reaction
abengtsoncommented, Mar 14, 2019

I am really just using the Entity for validation and the api endpoints. Okay cool

Read more comments on GitHub >

github_iconTop Results From Across the Web

Symfony Api Platform 400 Not Found Error While doing ...
I would like to do default item crud operations with odm. I did with ORM it was okay but I have problems with...
Read more >
How to Fix the "Item Not Found" Windows Error When ...
Each time I was trying to delete the folder, Windows was giving me a prompt saying "This is no longer located in [location]....
Read more >
Why am I getting this error? "Item not found "
I get this item whenever I try and move certain folders. What happened first was that I backed up my old system to...
Read more >
The Operation Failed. An Object Could Not Be Found Error
An object could not be found” error is the common error encountered by the Outlook users while clicking on Send / Receive option....
Read more >
Common errors | Content API for Shopping
notFound ; Common causes, Attempting to delete a product that doesn't exist, or not specifying the product ID correctly in the URL for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found