stoplightio / prism

Turn any OpenAPI2/3 and Postman Collection file into an API server with mocking, transformations and validations.

Home Page:https://stoplight.io/open-source/prism

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

pasindufernando1 opened this issue · comments

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 <api_def.yaml> 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.

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.

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