Comments (2)
Hi @goldbergyoni, thanks for your question. You can choose the OpenAPI example to return by name by using the response.exampleName
property described here:
https://docs.imposter.sh/openapi_plugin/#overriding-examples
Something like this:
plugin: "openapi"
specFile: "spec-with-multiple-examples.yaml"
resources:
- path: /users/:id
method: get
pathParam:
id: foo
response:
exampleName: userExample1
- path: /users/:id
method: get
pathParam:
id: bar
response:
exampleName: userExample2
The userExample1
and userExample2
names would correspond to named examples
for this operation in your OpenAPI spec.
Hope this helps!
from imposter.
Improved docs in c01c242.
from imposter.
Related Issues (20)
- --recursive-config-scan fails all mocks when one config.yaml is wrong HOT 1
- 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 6
- 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
- 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
- Using Expression.regexify in content responses HOT 2
- Request to make Context.Request.toString() produce json HOT 1
- Add support for faker regexify and similar functions
- Let a percentage of requests fail HOT 2
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.