0

If I have an apiary.io API described like this:

### Create a User [POST]
+ Request (application/json; charset=utf-8)

        {
            "user_id": 1053,
            "username": "demo@demo.com",
            "email": "demo@demo.com",
            "active": "true"
        }

+ Response 201 (application/json)

        {
            "user_id": 1053,
            "username": "demo@demo.com",
            "email": "demo@demo.com",
            "active": "true"
        }

When I call it from my application and pass it data, it will always pass me back the described payload no matter what data I pass in.

Is there a way to get it to echo back the exact data that I passed in instead of the described payload?

Brian McCord
  • 4,943
  • 7
  • 32
  • 44

1 Answers1

0

According to Apiary docs/examples you can not, only static request-response mocking. Also you could track this issue.

If you want to use kind of advanced mocks I would suggest you wiremock. It's not so fancy, but way more feature reach. You could run it as a service and update mock mappings at runtime by sending HTTP requests.

Please check solution for your question using wiremock. Related documentation.

Ivan Lymar
  • 2,180
  • 11
  • 26