mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 14:20:29 +01:00
Make mapping filenames more user friendly #563
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MindaugasLaganeckas on GitHub (Dec 11, 2023).
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
@StefH commented on GitHub (Dec 11, 2023):
Sounds like a good feature.
I suggest some fine-tuning:
Add a new nullable config setting
PrefixForSavedMappingFile. Which has the default valuenulland can be set by the user to a string value.Replacing spaces to underscores is good idea.
You can start a PR for this if you like.
@MindaugasLaganeckas commented on GitHub (Dec 11, 2023):
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 😄
@StefH commented on GitHub (Dec 11, 2023):
I did think on that, normally I try to keep logic backwards compatible, however I do not think this will be a big impact.