Forum Discussion
This depends on what you want to achieve. The gradle config you shared ( I believe gotten from swagger-gradle-plugin README ) makes me think you want to build an OpenAPI specification out of JAX-RS based code as a file added to your project during build time. If this is the case you would define a gradle `resolve` task as described in README and execute it in your gradle build.
If your goal is instead exposing an OpenAPI specification at runtime at an URI like https://<yourserver>/../openapi.json, you would follow the main wiki (the only difference being declaring the dependencies in your gradle file instead of the maven POM
Yes, I'm trying to do the first option (documentation generated at build time).
I'm afraid, I'll need some help with getting that 'resolve' task described (I'm not experienced with Gradle either). I see some code for the resolve task in the README page but I'm not sure where I'm supposed to add it. Somewhere in the build.gradle file, I presume, but where specifically?
resolve { outputFileName = 'PetStoreAPI' outputFormat = 'JSON' prettyPrint = 'TRUE' classpath = sourceSets.main.runtimeClasspath resourcePackages = ['io.test'] outputDir = file('test') }
Related Content
Recent Discussions
- 3 days agoKF4UYC