WireMock-Net / WireMock.Net

WireMock.Net is a flexible product for stubbing and mocking web HTTP responses using advanced request matching and response templating. Based on the functionality from http://WireMock.org, but extended with more functionality.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make mapping filenames more user friendly

MindaugasLaganeckas opened this issue · comments

Is your feature request related to a problem? Please describe.
If a feature flag AppendGuidToSavedMappingFile is enabled, mapping file names can get very long.
For example, 'Proxy Mapping for POST _ordermanagement_v1_orders_53fd9d98-fd6f-4abf-a393-82b75a5997bc_cancel_ce216a13-e7d6-42d7-91ac-8ae709e2add1.json'. Long names is not an issue in itself. But the spaces (' ') in the name (Proxy' 'Mapping' 'for' 'POST) make navigating files in linux terminal more cumbersome.

Describe the solution you'd like
We suggest to remove the static never changing part of the filename "Proxy Mapping for " from the filename and remove a space between POST and the request url. So the filename in the example would turn into
'POST_ordermanagement_v1_orders_53fd9d98-fd6f-4abf-a393-82b75a5997bc_cancel_ce216a13-e7d6-42d7-91ac-8ae709e2add1.json'

Describe alternatives you've considered
I have considered keeping the name as it is.

Additional context
I can implement the update if we can agree on the solution 😄 I suggest to either always make names shorter in combination with AppendGuidToSavedMappingFile or create an extra flag for it, e.g. MakeMappingFilenamesMoreConcise

Sounds like a good feature.

I suggest some fine-tuning:

  1. Add a new nullable config setting PrefixForSavedMappingFile. Which has the default value null and can be set by the user to a string value.

  2. Replacing spaces to underscores is good idea.

You can start a PR for this if you like.

Deal! Thank you! One clarification: should the default value not be "Proxy_Mapping_for_" or even "Proxy Mapping for " to keep the current behavior intact?
I will work on a PR later today/this week 😄

One clarification: should the default value not be "Proxy_Mapping_for_" or even "Proxy Mapping for " to keep the current behavior intact?

I did think on that, normally I try to keep logic backwards compatible, however I do not think this will be a big impact.