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

✨ Add [#examples ...] directive #81

Open
johannchopin opened this issue Aug 15, 2021 · 0 comments
Open

✨ Add [#examples ...] directive #81

johannchopin opened this issue Aug 15, 2021 · 0 comments
Labels
future A nice to have but not top priority

Comments

@johannchopin
Copy link
Owner

johannchopin commented Aug 15, 2021

The initial idea come from https://github.com/APIs-guru/graphql-faker where you can define an array of possible values to use. Could be nice to have such a syntax in restapify like:

{
  "name": "[#example 'Jojo' 'Luna']",
  "emails": "[#examples '[email protected]' '[email protected]' '[email protected]']"
}

...that will produce for example:

{
  "name": "Luna",
  "emails": ["[email protected]", "[email protected]"]
}
  • "[#example ...]" should only return a single value
  • "[#examples ...]" should return a random amount of items in a array between 1 and the list length without containing duplicates
  • No need of casting syntax here -> if you need a boolean or number value don't wrap it between a '
@johannchopin johannchopin changed the title ✨ Add [#examples ---] ✨ Add [#examples ...] syntax Aug 15, 2021
@johannchopin johannchopin changed the title ✨ Add [#examples ...] syntax ✨ Add [#examples ...] directive Aug 15, 2021
@johannchopin johannchopin added the future A nice to have but not top priority label Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
future A nice to have but not top priority
Projects
None yet
Development

No branches or pull requests

1 participant