I'm getting an error "mockRequestNotFoundError" when doing mock request

Describe the bug
When doing mock request I get an error:
{
“error”: {
“name”: “mockRequestNotFoundError”,
“message”: “This collection does not have any Examples. Please add examples to the requests in this collection to enable mocking.”
}
}

To Reproduce

Expected behavior
Return response 200 OK

App information (please complete the following information):

  • App Type: Native App
  • Postman Version: 7.1.1
  • OS: macOS Mojave 10.14

When

  • not change version in collection activity feed
  • create mock server for current version

mocking works.

@tmdo - Looks like you are adding an example response to the draft version of the collection. The example did not exist when you created a mock on the 0.0.1 version of the collection. Hence you get the error message saying that no saved examples exist for this collection. To fix this you should delete the version tag on the collection and add the same version tag again on the changelog after you have created the saved example and try creating the mock again.

1 Like

It seems that what @pratik suggested solves the issue, not I am not sure why does this not always work.

I am sorry to say, but adding versions to collections is really a mess when working with mock servers. There is no visual clue which mock servers is linked to which version.

@pratik any ideas on why the following is not working?

@vdespa - The Changelog is not updated in real-time. Can you click on the refresh icon and verify that the version tag was created after the example response was added/modified to the collection?

@pratik Yes, I have tried it multiple times in the order of:

  • create collection & examples
  • tag latest version
  • create mock server

It always works with current but never with tags.