You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful for Prism to fallback to static generation (or dynamic if set) if this happens instead of throwing an error.
Context
We are using Prefer headers to control the examples that we deliver, but don't necessarily need examples for every endpoint. It would be nice to still send the Prefer header key, but fallback to static generation if it doesn't exist
The text was updated successfully, but these errors were encountered:
thanks for the issue @louzena-inshur. we are reluctant to implement this as it could cause unexpected behavior in the case of typos or other bad configuration. we find it important that the client is aware of this mismatch. we would take a PR to improve the response error message (and status code).
Thanks @daniel-white , that makes sense with improving the response error message and that you'd want to be explicit if a keyed example was not found.
Perhaps one to think about - having an argument on the CLI for fallbacks like this. Could fallback to a singular 'example' if it exists, when an argument is set?
If you pass a Prefer header with an example key, and that key does not exist, then Prism returns an error
Request terminated with error: https://stoplight.io/prism/errors#NOT_FOUND: The server cannot find the requested content
It would be useful for Prism to fallback to static generation (or dynamic if set) if this happens instead of throwing an error.
Context
We are using Prefer headers to control the examples that we deliver, but don't necessarily need examples for every endpoint. It would be nice to still send the Prefer header key, but fallback to static generation if it doesn't exist
The text was updated successfully, but these errors were encountered: