openmock icon indicating copy to clipboard operation
openmock copied to clipboard

wildcard routes can be ambiguous

Open sesquipedalian-dev opened this issue 1 year ago • 0 comments

HTTP routes containing wildcards can be ambiguous with routes that are longer. For example:


- key: hello-wildcard
  kind: Behavior
  expect:
    http:
      method: GET
      path: /hello/*/bar
  actions:
    - reply_http:
        status_code: 200
        body: >
          { "hello": "foo" }

- key: hello-wildcard-2
  kind: Behavior
  expect:
    http:
      method: GET
      path: /hello/*
  actions:
    - reply_http:
        status_code: 200
        body: >
          { "hello": "bar" }

With these routes, calls to /hello/foo/bar will be ambiguous. It looks like once openmock loads in the templates, it is consistent until reloaded. For some loads, the response body will be {"hello": "foo"} and other times it will be {"hello": "bar"}.

sesquipedalian-dev avatar Jan 12 '24 16:01 sesquipedalian-dev