Skip to content

Fix #1492: Serialize WithClientIP matcher to Request.ClientIP - #1493

Merged
StefH merged 1 commit into
wiremock:masterfrom
Bafyn:fix/clientip-mapping-serialization
Aug 6, 2026
Merged

Fix #1492: Serialize WithClientIP matcher to Request.ClientIP#1493
StefH merged 1 commit into
wiremock:masterfrom
Bafyn:fix/clientip-mapping-serialization

Conversation

@Bafyn

@Bafyn Bafyn commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Problem

When a mapping that uses WithClientIP() is serialized to its MappingModel, the client‑IP matcher is not written to Request.ClientIP. Instead it is written to Request.Path.

Root cause

  • Serialize - MappingConverter.ToMappingModel assigned the client-IP matchers to mappingModel.Request.Path.
  • Deserialize - WireMockServer.ConvertMapping.InitRequestBuilder rebuilt the object-form Request.ClientIP via WithPath() instead of WithClientIP().

References

Fixes #1492

Submitter checklist

  • The PR request is well described and justified, including the body and the references
  • The PR title represents the desired changelog entry
  • The repository's code style is followed (see the contributing guide)
  • Test coverage that demonstrates that the change works as expected

@Bafyn
Bafyn marked this pull request as draft August 5, 2026 06:48
@Bafyn
Bafyn marked this pull request as ready for review August 5, 2026 06:48
@StefH StefH added the bug Something isn't working label Aug 5, 2026
@StefH
StefH merged commit d39f7c7 into wiremock:master Aug 6, 2026
6 checks passed
@Bafyn
Bafyn deleted the fix/clientip-mapping-serialization branch August 6, 2026 19:13
This was referenced Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WithClientIP matcher is lost / corrupted when a mapping is serialized

2 participants