Open movinfinex opened 2 days ago
Hi @movinfinex, as the spec also sets a basePath
of /api
, you can remove it from your config file. It may be duplicating the path to be /api/api/pets/{petId}
.
If this doesn't help, please could you share the log output from startup?
Okay, I did some more experimentation. The problem occurs when the placeholder name in the config file doesn't match the placeholder name in the OpenAPI schema. In the example above, the schema uses {id}
and the config uses {petId}
. My original real-world config had a similar issue. When I make the placeholder names match, everything works as expected.
FWIW, I was able to reproduce it with minimal configs with and without basePath
usage.
Hi, thanks for the useful testing tool.
I'm trying to reproduce something like the example in the docs here: https://docs.imposter.sh/openapi_plugin/#overriding-status-code
Here's a short config that tries to match requests using a placeholder in the path:
However, it doesn't match requests, and I get a response generated from the schema instead:
The
{petId}
syntax is taken from the example code, but the docs below it actually saySo I tried
path: "/pets/:petId"
, but that doesn't match, either.If I use
path: "/pets/123"
, then the path matches and I get the 404, but that isn't parameterised, of course.