Create Mock Service API using Apiary

只谈情不闲聊 提交于 2019-12-06 10:34:45

问题


I'm attempting to create mock api services for testing purposes. We are already using Apiary on another team so I'm starting there.

So far, I've noticed that if I want to have two separate calls requires mocking out of both requests. For example to get the notes with ids 1 and 2 requires explicitly writing out responses like:

/notes/1 /notes/2

Is there a way to avoid this? Admittedly I'm still ramping up on creating blueprints.


回答1:


Have a look at private-e9e59-pingdomcheck.apiary-mock.com/v1/gists/1. The number 1 is {id} here. You of course get only the general defined response (like if I used id 42).

There are more things being done right now in MSON. Once it's released, different replies for different parameters in request will be possible.



来源:https://stackoverflow.com/questions/28682002/create-mock-service-api-using-apiary

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!