Skip to content

Match on partial body in mock #1068

@cjsahansra

Description

@cjsahansra

When including the body in the mock, is there a way to only include a partial match on a single field? For example, if the full request body is something like this:

{
   "item": "00001",
   "color": "blue",
   "model" "X"
}

but I want the mock to only match on a single field like "item" and ignore whatever is in the remaining fields:

{
  "name": "some name",
  "request": {
    "url": "/some/url",
    "method": "POST",
    "body": {
      "item": "00001"
    }
  },
  "responses": {
    "ok": {
      "default": true,
        "data": {"response": "default mock"}
    }
}

Is this possible with ng-apimock or do I need to include the full request body in the mock?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions