Hi all, this was supposed to be simple but it is n...
# help
k
Hi all, this was supposed to be simple but it is not I'm using the
wiremock/wiremock:3.13.2
docker image with the
wiremock-state-extension:0.10.1
. I'm getting an
Unrecognized field
error for
serveEventListeners
Is 0.10.1 extension fully compatible with the WireMock 3.x core, or do I need a specific startup flag to allow legacy field mapping? In case, content of extensions dir as follows
Copy code
[       4096]  ./extensions/
├── [      30245]  accessors-smart-2.6.0.jar
├── [    1020615]  caffeine-3.2.3.jar
├── [    3046899]  datafaker-2.5.4.jar
├── [     287913]  json-path-3.0.0.jar
├── [     340068]  snakeyaml-2.6.jar
├── [       1982]  wiremock-faker-extension-0.2.0.jar
└── [      60089]  wiremock-state-extension-0.10.1.jar
docker run command
Copy code
docker run -it --rm \
  -p 8443:8443 \
  -v $(pwd)/mappings:/home/wiremock/mappings \
  -v $(pwd)/extensions:/var/wiremock/extensions \
  wiremock/wiremock:latest \
  --https-port 8443 \
  --verbose \
  --global-response-templating
mapping file loading which fails
Copy code
{
  "request": {
    "method": "POST",
    "url": "/state/enable"
  },
  "response": {
    "body": "User logged in",
    "serveEventListeners": [
      {
        "name": "state",
        "parameters": {
          "context": "auth",
          "state": {
            "loggedIn": "true"
          }
        }
      }
    ],
    "status": 200
  }
}
Error log
Copy code
2026-04-23 12:04:09.816 Verbose logging enabled
Exception in thread "main" com.github.tomakehurst.wiremock.standalone.MappingFileException: Error loading file /home/wiremock/./mappings/state-set.json:
Unrecognized field "serveEventListeners" (class com.github.tomakehurst.wiremock.http.ResponseDefinition), not marked as ignorable
	at com.github.tomakehurst.wiremock.standalone.JsonFileMappingsSource.loadMappingsInto(JsonFileMappingsSource.java:126)
	at com.github.tomakehurst.wiremock.core.WireMockApp.loadMappingsUsing(WireMockApp.java:288)
	at com.github.tomakehurst.wiremock.core.WireMockApp.loadDefaultMappings(WireMockApp.java:282)
	at com.github.tomakehurst.wiremock.core.WireMockApp.<init>(WireMockApp.java:143)
	at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:68)
	at com.github.tomakehurst.wiremock.standalone.WireMockServerRunner.run(WireMockServerRunner.java:71)
	at wiremock.Run.main(Run.java:23)
r
the
serveEventListeners
field is a top level field of a stub mapping. if you pull it out of the
response
field into the root object, it should resolve that error