Giter Site home page Giter Site logo

support for basePath about prism HOT 6 CLOSED

flixr avatar flixr commented on June 14, 2024
support for basePath

from prism.

Comments (6)

chohmann avatar chohmann commented on June 14, 2024

@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.

flixr avatar flixr commented on June 14, 2024

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.

chohmann avatar chohmann commented on June 14, 2024

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.

flixr avatar flixr commented on June 14, 2024

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.

displague avatar displague commented on June 14, 2024

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.

chohmann avatar chohmann commented on June 14, 2024

@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 to https://api.equinix.com/metal/v1/user? Or does it forward the request to https://api.equinix.com/user?

from prism.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.