Comments (6)
@flixr this is actually working as originally designed. This is documented in the Prism Docs in the 2nd question of the FAQ section.
from prism.
Thanks, missed that FAQ entry.
But this basically means I can't use that with Swagger/OAS2 for mocking with this prefix... Or am I missing something else?
from prism.
Yeah you'd have to build whatever you'd put in the basePath
property, into the paths themselves. Alternatively, you can use Prism v2 which should have the functionality you're looking for.
from prism.
Ok, thanks.
A bit of a shame though...
Would be good if prism would have respected it if the definition loaded is a v2 def... instead of just implicitly always going with the v3 logic.
from prism.
I ran into this problem with an OAS3 spec where the servers block includes a path:
servers:
- url: https://api.equinix.com/metal/v1
All of the OAS3 paths
definitions are relative to that root.
The tools that I want to validate against the proxy know to use /metal/v1
. I have to manipulate those tools a good bit to fit the prism pattern. It would be nice for Prism to expose an argument for a base path.
If base-path
were an option, this could look like:
prism proxy equinix-openapi3.yaml https://api.equinix.com/metal/v1 --errors --base-path /metal/v1
Without it, the output reports the proxy URLs on a root that doesn't match what tools will expect:
[4:34:17 PM] › [CLI] ℹ info PUT http://127.0.0.1:4010/user
from prism.
@displague could you open up a new Github Issue for the issue you're describing?
In the new Github Issue could you include the following information:
- a complete spec that illustrates your issue
- what prism command you ran
- when requesting to
http://127.0.0.1:4010/user
does prism ultimately forward the request tohttps://api.equinix.com/metal/v1/user
? Or does it forward the request tohttps://api.equinix.com/user
?
from prism.
Related Issues (20)
- Allow Binary Requests To Succeed in Prism Proxy Mode HOT 6
- Spike: Investigate testing on multiple operating systems
- Support for default JSON deserialization of arrays of objects in form data request bodies in OpenAPI 3 HOT 5
- Consider falling back to a statically generated response when no example key exists from Prefer header HOT 2
- Command-line flag to dynamically generate default valid examples in place of invalid static examples HOT 1
- Internal `$ref` resolution in a referenced external JSON Schema is incorrectly resolved against OAS context HOT 3
- fillproperties / additionalProperties are no longer generated when using dynamic parameter and there is a required property set HOT 2
- Gherkin Scenario for Prism HOT 3
- `prism --dynamic` returns 500's with `TypeError: Cannot read properties of null (reading 'value')` HOT 4
- Feature: support Optional security and AND security scheme groups HOT 1
- Urls generated with Ids could be static
- arrays never have less than maxItems in dynamic responses HOT 5
- Bug: JSON body parsing with "qouted" JSON-keys HOT 1
- Wrong validation of request body with integer type property HOT 2
- "title": "Tried to force a dynamic response for: application/json but schema is not defined.", HOT 1
- Prism Client not validating request and response from Server despite setting mock: false. HOT 1
- Update http-spec dependency HOT 2
- Multiple cookies in Set-Cookie header at one response HOT 8
- Serving Multiple OpenAPI Documents - Without any/differing prefixes? HOT 1
- Spike: Slow dns lookups from api-design to hasura
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 prism.