Cannot get error when getting specific resource and resource doesn't exist


I have the following code:

  description: Retrieve a booking
          example: |
         example: |
                  "BookingID": 1,
                  "Driver": "John Doe",
                  "VehicleID": 1,
                  "Registration": "CHH708",
                  "Fleet": "DN30",
                  "Destination": "Akaroa",
                  "Notes": "Going to ...",
                  "StartTimezone": null,
                  "Start": "2014/11/20 08:00",
                  "End": "2014/11/20 11:00",
                  "EndTimezone": null,
                  "RecurrenceRule": null,
                  "RecurrenceID": null,
                  "RecurrenceException": null,
                  "Pickup": false
              "success": true,
              "status": 200

And when I get bookings/1 it returns the right entry but if I try bookings/2 or any id, it also returns that entry, how do I get it to return 404 no such resource ?


Are you using the mocking service?


Yes Christian I am.


Currently, the mocking service takes your examples to provide you with a response when requesting a specific resource. As of today, you’re not able to get responses back based on different error codes for example if you ask for a resource which is not present. It will always provide you with the example. To have such “logic” means more intelligence from the mocking service which has to be implemented. I don’t know if that is somewhere on the Roadmap.

To provide this, you have to provide your own logic unfortunately. If you use Java you can easily create JAX-RS stub and create your own mocking in just sec.

Does that answer your question?