Skip to content

Consider falling back to a statically generated response when no example key exists from Prefer header  #2381

@louzena-inshur

Description

@louzena-inshur

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions