Hi everyone!
I'm going to use generated Java client for testing purposes. Part of the tests should verify things like what is the response from endpoint in case of requests with empty body (or broken json/xml etc). For now I don't see how I can do that, because methods in the generated API's accept specific objects (models). There is an option to use 'invokeAPI()' method from ApiClient, but in that case I need to pass path to the endpoint. That means that I need to keep paths somewhere and as result duplicate them, because I can't fetch them from methods of generated API class.
I assume that it is possible to update the template for API generation and in addition to regular methods, create methods to accept String instead of specific object. So, couple of questions here:
- can I update just one file (api.mustache), put it in directory and pass it as '-t' value?
- is it possible to generate this additional methods only for cases of PUT/POST requests?
Please share your ideas about sending raw requests without necessity explicitly specify path and other params. Thanks in advance!