Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for sequences of responses per imposter #167

Merged
merged 1 commit into from
May 27, 2024
Merged

Conversation

joanlopez
Copy link
Member

Similar to #68, but following a different approach:

  • The entire response field allows multiple responses, so the user cannot only configure multiple bodies, but can also configure different status codes, etc. Useful, for instance, when mocking non-idempotent endpoints. See the test example.
  • It should be backwards compatible, as:
    • it should still be able to read single response (no array) imposters
    • it should behave as it was used to when there's only a single response

In the future, we may want to explore adding different strategies (strategy or responseStrategy field) for how responses are alternated. For now, I guess that sequentially going over all of them is enough.

Closes #165 #31

@joanlopez joanlopez added the enhancement New feature or request label Apr 11, 2024
@joanlopez joanlopez requested a review from aperezg April 11, 2024 05:57
@joanlopez joanlopez self-assigned this Apr 11, 2024
Copy link

@kilianc kilianc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@joanlopez joanlopez merged commit 392da86 into main May 27, 2024
3 checks passed
@joanlopez joanlopez deleted the multiple-responses branch May 27, 2024 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature request: ability to define a sequence of responses
2 participants