diff --git a/README.md b/README.md index 886111a..e93d189 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,9 @@ Mock definition: "host": "example.com", "method": "GET|POST|PUT|PATCH|...", "path": "/your/path/:variable", + "pathVariables": { + "variable": "\\d*" + }, "queryStringParameters": { "name": ["value"], "name": ["value", "value"] @@ -201,6 +204,7 @@ A core feature of Mmock is the ability to return canned HTTP responses for reque * *host*: Request http host. (without port) * *method*: Request http method. It allows more than one separated by pipes "|" **Mandatory** * *path*: Resource identifier. It allows :value matching. **Mandatory** +* *pathVariables*: A map of path variables to regexp that they need to match against. { "value": "\\d*" } * *queryStringParameters*: Array of query strings. It allows more than one value for the same key. * *headers*: Array of headers. It allows more than one value for the same key. **Case sensitive!** * *cookies*: Array of cookies. @@ -228,6 +232,7 @@ Query strings and headers support also global matches (*) in the header/paramete Regexp matching is available for: - body - query strings +- path variables See https://pkg.go.dev/regexp/syntax for regexp syntax @@ -627,6 +632,7 @@ You can always disable this behavior adding the following flag `-server-statisti - Support Regular Expressions for Field Values in JSON Request Body thanks to [@rosspatil](https://github.com/rosspatil) - Improved logging with levels thanks to [@jcdietrich](https://github.com/jcdietrich) [@jdietrich-tc](https://github.com/jdietrich-tc) - Support for Regular Expressions for QueryStringParameters [@jcdietrich](https://github.com/jcdietrich) [@jdietrich-tc](https://github.com/jdietrich-tc) +- Support for Regular Expressions for Path Variables [@jcdietrich](https://github.com/jcdietrich) [@jdietrich-tc](https://github.com/jdietrich-tc) ### Contributing