gstroup / apimocker

node.js module to run a simple http server for mock service responses.
MIT License
280 stars 81 forks source link

Switch by json key #33

Closed dploeger closed 9 years ago

dploeger commented 9 years ago

I have the following request structure (all requests POST to /):

AuthRequest:

{
  "Header": {...},
  "Body": {
    "AuthRequest": { <Parameters for Auth Request> }
  }
}

GetMailboxRequest:

{
  "Header": {...},
  "Body": {
    "GetMailboxRequest": { <Parameters for GetMailbox Request> }
  }
}

I'd have to deliver two mocks. One for the AuthRequest and one for the GetMailboxRequest.

So I need to switch by the first key of "Body"? Is this possible? I don't see how I can configure this. JsonPath doesn't seem to work for this specific task.

gstroup commented 9 years ago

I believe this is fixed now, by your pull request. Right? If so, I will close this issue. Thanks.

dploeger commented 9 years ago

Yes. I can work around this using the new regexp feature. Thanks.