https://linen.dev logo
#general
Title
# general
j

Jackie chen

05/26/2023, 4:56 AM
Hello! looks like wiremock does not support filters in Recording api, /__admin/recordings/start giving the below request:
Copy code
{
  "targetBaseUrl": "<http://examples.wiremockapi.cloud/>",
  "filters": {
    "urlPathPattern": "/api/.*",
    "method": "GET"
  }
}
The result mapping:
Copy code
{
  "id": "5557dad5-1f19-4184-91ab-7b0103bdc42a",
  "request": {
    "method": "ANY"
  },
  "response": {
    "status": 200,
    "proxyBaseUrl": "<http://examples.wiremockapi.cloud/>"
  },
  "uuid": "5557dad5-1f19-4184-91ab-7b0103bdc42a"
}
could you please suggest?
o

Oleg Nenashev

05/26/2023, 10:15 AM
Hmm...
t

Tom

05/26/2023, 10:17 AM
Hi @Jackie chen, can you elaborate a bit - what are you expecting to see here?
o

Oleg Nenashev

05/26/2023, 10:19 AM
I think the expectation is that only requests matching the
urlPathPattern": "/api/.*
pattern are recorded
And the response mapping does not include the endpoint
Maybe an RFE, but indeed one could expect that the recording filters are copied over to the mapping file when a response is recorded
t

Tom

05/26/2023, 10:21 AM
That stub is the proxy stub used by the recorder, not the result of a recording.
It gets deleted when you stop recording
j

Jackie chen

05/26/2023, 11:48 PM
Hi @Oleg Nenashev @Tom the expectation is that the recorder only records the http requests that match with the /api/.* pattern and they are recorded. I understand that that stub is deleted when the recording is stopped but i get the mapping to check if that stub shows the right filters condition (i don’t expect the proxyBaseUrl
Copy code
"proxyBaseUrl": "<http://examples.wiremockapi.cloud/>"
stub mapping to be recorded). Also, i verified this by recording other http requests that do not match the /api/.*, and it can be recorded. It means that the filters parameter does not work as expected in /__admin/recordings/start api