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

API/routes documentation #63

Closed
globerVictor opened this issue Sep 27, 2018 · 3 comments
Closed

API/routes documentation #63

globerVictor opened this issue Sep 27, 2018 · 3 comments
Assignees

Comments

@globerVictor
Copy link

API Documentation:
Would be nice to have an input field in each route's form where we can add some comments about how it works and the expected behavior. Let's say for example I'm developing an API REST with JSON, would be nice that for each route we could have a way to specify all the possible answers for that specific route (one answer for 200 OK, other for 404 Error answers, etc) so based in this could be generated a simple but helpful documentation with all the expected schemas responses.

Dynamic Responses:
Additional those different answers in route would be activated in the Mockoon service by two approaches: The first approach could be to use a button in the Moockon UI that sets a response as the currently active and the second and more interesting one would be to parse one or more parameters from the GET/POST or Headers to dynamically route the request to the indicated response.

I'm so sorry if this is not enough explanatory, I'm not a UI designer, Just a mobile developer searching for a powerful but easy and open tool to test mocked services and would be wonderful find something like the described above (at least one of both features) on this product

@mocktastic
Copy link

Apologies for the shameless shilling I'm going to do.

We built a very similar tool to mockoon called Mocktastic. Though the focus in Mocktastic is more on collaborating with your team to easily create and use mock REST servers, Mocktastic also works for individual developers.

The first approach could be to use a button in the Moockon UI that sets a response as the currently active and the second and more interesting one would be to parse one or more parameters from the GET/POST or Headers to dynamically route the request to the indicated response.

This exact feature (both with the button as well as dynamically using a header) are available in Mocktastic. In Mocktastic, each API endpoint can have an unlimited number of responses. Any one response can be set as the active response using the Mocktastic GUI.

In case you want to dynamically get a different response from what is set as the active response, you can send an x-mocktastic-return-status header with a value corresponding to the response with the http status code you want returned.

Do give it a try, and you can also open an issue at our Github issues page.

Once again, apologies for the shilling, but I felt this was exactly what the OP was looking for.

@255kb
Copy link
Member

255kb commented Oct 1, 2018

@globerVictor Nice idea for adding comments/documentation on routes. Concerning the dynamic response I will investigate the time needed to add this.

@mocktastic No problem :) I know that some other tools are more complete than Mockoon. I also really want to keep Mockoon simple, because at one point if the tool let you do everything you should really start building this API instead of mocking it 😃

@255kb 255kb changed the title API documentation with dynamic responses API documentation Nov 7, 2018
@255kb 255kb self-assigned this Nov 7, 2018
@255kb 255kb added this to the Next release milestone Nov 7, 2018
@255kb
Copy link
Member

255kb commented Nov 7, 2018

API documentation is planned for next release, but dynamic response will be tracked in issue #75

@255kb 255kb changed the title API documentation API/routes documentation Nov 7, 2018
@255kb 255kb closed this as completed in 74249ec Dec 16, 2018
@255kb 255kb removed this from the Next release milestone Dec 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants