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

Request/Response Mocks Defined As OpenAPI Examples #37

Open
evan111 opened this issue Apr 15, 2019 · 1 comment
Open

Request/Response Mocks Defined As OpenAPI Examples #37

evan111 opened this issue Apr 15, 2019 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@evan111
Copy link

evan111 commented Apr 15, 2019

Issue
A present Open API 3.0 Examples are returned randomly, the only differentiator is setting a Preferred HTTP response code:

         // Choose a random example to return.
	keys := make([]string, 0, len(mt.Examples))
	for k := range mt.Examples {
		keys = append(keys, k)
	}
	selected := keys[rand.Intn(len(keys))]
	return mt.Examples[selected].Value.Value, nil

Request
It would be great if we could define which mocks to return also using path params, query strings, and even request/response payloads. See how Microcks uses this ability: http://microcks.github.io/using/openapi/

@danielgtaylor danielgtaylor added enhancement New feature or request help wanted Extra attention is needed labels May 31, 2019
@danielgtaylor
Copy link
Owner

See also #21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants