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

feat: Extra duration with a min and max duration #260

Closed
dukeofharen opened this issue Aug 14, 2022 · 0 comments · Fixed by #268
Closed

feat: Extra duration with a min and max duration #260

dukeofharen opened this issue Aug 14, 2022 · 0 comments · Fixed by #268
Labels
enhancement Enhancement of the code, not introducing new features.

Comments

@dukeofharen
Copy link
Owner

dukeofharen commented Aug 14, 2022

Feature Request

Describe the Feature Request

As can be read here, it is possible to delay the response with an x amount of milliseconds before returning it, to simulate a slow connection. It would be nice to also provide a min and a max number of milliseconds. This way, HttPlaceholder will pick a random number in between these 2 numbers. HttPlaceholder will wait this amount of milliseconds longer before returning the response.

Describe Preferred Solution

Here is an example of how this might look like:

- id: slow
  conditions:
    method: GET
    url:
      path:
        equals: /slooooow
  response:
    text: This was very slow.
    extraDuration:
      min: 20000
      max: 40000

Make sure to:

  • update the OpenAPI definition of the extraDuration.
  • update the stub validator so min can not be larger than / equal to max.

Describe Alternatives

Related Code

Additional Context

If the feature request is approved, would you be willing to submit a PR?
Yes / No (Help can be provided if you need assistance submitting a PR)

@dukeofharen dukeofharen added the enhancement Enhancement of the code, not introducing new features. label Aug 14, 2022
@dukeofharen dukeofharen linked a pull request Sep 2, 2022 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of the code, not introducing new features.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant