stoplightio / prism

Turn any OpenAPI2/3 and Postman Collection file into an API server with mocking, transformations and validations.
https://stoplight.io/open-source/prism
Apache License 2.0
4.25k stars 345 forks source link

Facilitate fully dynamic response generation by default in "prism proxy" scenario #2529

Open pasindufernando1 opened 4 months ago

pasindufernando1 commented 4 months ago

Description

Currently, Prism Proxy lacks support for enabling dynamic mode by default, which necessitates the manual addition of the "Prefer: dynamic=true" header to each request. This approach poses challenges, particularly when integrating the Faker library for API property simulation, and detracts from user experience. Without the header addition the only response that can be generated is something like image

Proposal

I suggest enhancing Prism Proxy to allow users to run it in default dynamic mode, eliminating the need for manual header assignment. This would significantly improve usability and streamline the integration process.

Proposed Solution

Introduce a command syntax enabling dynamic mode by default:

prism proxy -d http://localhost:8080

Expected Behavior

With dynamic mode enabled by default, users can seamlessly integrate Prism Proxy into their workflows without the overhead of manually configuring headers for each request.

Impact

This enhancement will enhance user experience, particularly for scenarios involving Faker library integration, by simplifying the process and reducing manual effort.

brendarearden commented 4 months ago

This does look like something we should add as a command line option for proxy mode!

Potential Solution: Move dynamic and json-schema-faker-fillProperties from the mock commands into the shared options. Any tests needed for dynamic mode in proxy, along with documentation updates for new cli command usages.

github-actions[bot] commented 4 months ago

This ticket has been labeled jira. A tracking ticket in Stoplight's Jira (STOP-536) has been created.