question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ExactMatcher with array pattern not working?

See original GitHub issue

Hi, So I created this mapping:

{
    "Guid": "57cb97c5-d307-40d9-9a50-a8bf4c0842e5",
    "Priority": 0,
    "Request": {
      "Path": {
        "Matchers": [
          {
            "Name": "WildcardMatcher",
            "Pattern": "/test",
            "IgnoreCase": false
          }
        ]
      },
      "Methods": [
        "get"
      ],
      "Params": [
        {
          "Name": "ids",
          "Matchers": [
            {
              "Name": "ExactMatcher",
              "Patterns": [
                "1",
                "2"
              ]
            }
          ]
        }
      ]
    },
    "Response": {
      "StatusCode": 200,
      "BodyDestination": "SameAsSource",
      "Body": "OK",
      "UseTransformer": false,
      "Headers": {
        "content-type": "application/json; charset=utf-8"
      }
    }
  }

And I’m making this request:

{
    "Guid": "d4e602a8-095c-4ae6-ab15-9aefbb14c22f",
    "Request": {
      "ClientIP": "****",
      "DateTime": "2019-03-19T14:54:05.2688502+00:00",
      "Path": "/test",
      "AbsolutePath": "/test",
      "Url": "http://mss.ait.env.works:54024/test?ids=1,2",
      "AbsoluteUrl": "http://mss.ait.env.works:54024/test?ids=1,2",
      "Query": {
        "ids": [
          "1",
          "2"
        ]
      },
      "Method": "get",
      "Headers": {
        "X-P2P-PeerDist": [
          "Version=1.1"
        ],
        "X-P2P-PeerDistEx": [
          "MinContentInformation=1.0, MaxContentInformation=2.0"
        ],
        "Connection": [
          "Keep-Alive"
        ],
        "Accept": [
          "text/html, application/xhtml+xml, image/jxr, */*"
        ],
        "Accept-Encoding": [
          "gzip, deflate, peerdist"
        ],
        "Accept-Language": [
          "en-US,en;q=0.8,de-DE;q=0.5,de;q=0.3"
        ],
        "Host": [
          "mss.ait.env.works:54024"
        ],
        "User-Agent": [
          "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299"
        ]
      }
    },
    "Response": {
      "StatusCode": 404,
      "Headers": {
        "Content-Type": [
          "application/json"
        ]
      },
      "BodyAsJson": {
        "Status": "No matching mapping found"
      },
      "BodyEncoding": {
        "CodePage": 65001,
        "EncodingName": "Unicode (UTF-8)",
        "WebName": "utf-8"
      }
    }
  }

but as you can see it does not work as I’m not getting the expected response. What am I doing wrong?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18

github_iconTop GitHub Comments

1reaction
StefHcommented, Mar 20, 2019

It’s a bug. Thanks for finding.

0reactions
FSatmarcommented, Mar 26, 2019

Cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rerunning parametrized JUnit test with string array ...
Is there an easy way to fix this, perhaps with List s or variadic arguments? Most of the (100+) test cases are simple...
Read more >
Creating a Java Array from Regular Expression Matches
In this tutorial, we'll learn how to create an array from a regular expression (regex) output. 2. Introduction. For our example, let's parse...
Read more >
Determine if pattern matches strings - MATLAB matches
If pat is an array containing multiple patterns, then matches returns 1 if it finds that any element of pat matches str ....
Read more >
Determine if pattern is in strings - MATLAB contains
This MATLAB function returns 1 (true) if str contains the specified pattern, and returns 0 (false) otherwise.
Read more >
Arrays.toString() in Java with Examples
Convert Arrays to String in Java using Arrays.toString() with examples. Why does Object.toString() not work for Arrays as Arrays.toString()?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found