I want to generate a sample request and response from a swagger definition file(yaml/json). The intent is to stub out these APIs.
Unfortunately I do not have admin rights to install any of the server frameworks listed in the generate server list of the swagger editor. I've also tried mocking it with soapui(5.x) and ready api , but both of them are not able to resolve the schema references within the response objects of the definition file - Eg:
"responses": {
"200": {
"description": "pet response",
"schema": {
"$ref": "**#/definitions/Pet**"
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "**#/definitions/ErrorModel**"
}
}
Is there a simple way to generate the mock requests and responses from the definition?
Thanks,
I think this (http://apigee.com/about/blog/developer/swagger-test-templates-test-your-apis) is what you're looking for.
It goes through a list of products (Handlebars JS, Mocha JS, Commander JS) and how to orchestrate them to get some test code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With