Comments (7)
Hey @outofcoffee thanks for fixing this.
from imposter.
Hi @Satish1994 - thanks for taking the time to raise this. The issue you referenced was closed after the issue author did not provide a Swagger/OpenAPI file and config file that reproduced the issue. The ticket was open for several months but unfortunately no details were provided :(
Are you able to provide this information to help diagnose the problem?
from imposter.
Here is my config file
plugin: openapi
specFile: openapi.yaml
from imposter.
Here is my openapi.yaml spec file
https://gist.github.com/satish1994/8c9d5ac106dbe9ea310017bbe842ec1b
Consider two request /transfers with GET method and /transfers/accounts with GET method, if I try GET /transfers/accounts, I receive the responses of /transfers instead of /transfers/accounts, both have different example responses
from imposter.
Hi @Satish1994, from what I can see, the request path /transfers/accounts
is matching the OpenAPI operation for /transfers/:id
when the request is received. It seems that account
is being interpreted as the id
path parameter. This is obviously not what you expected given there is an explicit operation for /transfers/accounts
.
As far as the identical response is concerned, in your OpenAPI spec, the examples for /transfers
and /transfers/:id
are the same - I suspect, based on the model reference in the listTransfers
operation that you intended the example for that to be an array (as per StandardResponseCollectionTransferResponseVO
rather than StandardResponseTransferResponseVO
).
In any case, the matching to operation by exact path is ambiguous, so we should consider that a bug.
The path matching is performed by Vert.x Web rather than any custom logic in Imposter. The issue is described in this Stack Overflow post: https://stackoverflow.com/questions/49829056/vertx-web-route-distinction-between-the-path-uri-and-path-param
It seems reasonable for Imposter to prefer routes with exact matches over those with path placeholders, so I will make this change in the next release (v2.13.0).
from imposter.
Hi @Satish1994 v2.13.0 is now released - does this resolve your issue?
from imposter.
Closing as fixed. Please feel free to raise a new issue if there is still a problem.
from imposter.
Related Issues (20)
- OpenApi specification using path variable with dash is not recognised HOT 3
- Allow usage of temporary security credentials to access AWS resources HOT 2
- Allow usage of temporary security credentials to access AWS resources (S3) HOT 2
- Strip whitespace for comma-delimited log header config HOT 1
- --recursive-config-scan fails all mocks when one config.yaml is wrong
- imposter --dry-run
- docs: improve description of steps HOT 1
- build: remove deprecated nashorn-standalone-plugin JAR HOT 1
- issue in case of multiple matching HOT 8
- soap imposter-all issue with returning file as response HOT 1
- Healthcheck / Readiness probe HOT 4
- Docker + S3 HOT 3
- Support for GRPC mocking HOT 2
- Http 500 error when navigating to Swagger UI HOT 6
- [Improvement] Add support to configure through a remote API
- Can I add basepath for _spec endpoint? HOT 2
- A way to instruct a specific OAI example response HOT 2
- Port test-containers example to module catalogue
- Issue with Swagger UI and combined.json in Imposter AWS Lambda Deployment
- Incorrect order for Server Path and OpenAPI config path
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imposter.