How to generate swagger.json using gradle? : <p>I want to use swagger-codegen to generate REST clients and possibly static HTML documentation.</p>

<p>However, swagger-codegen needs swagger.json for input.</p>

<p>I am aware, that I can get this from a running REST server equipped with Swagger.</p>

<p>But is there a way to obtain swagger.json directly from my Java code - i.e. to generate it with gradle from the source code - without the need to run the application in a web container, and pointing <code>curl</code>  or a browser to it?</p>
