3 ms·
Show HN: Generate a Groovy API Client Using OpenAPI Generator in 3 Steps
Hi all,
We've just updated the Groovy client generator to support the latest version of Groovy (2.5.7). To generate a Groovy API client given an OpenAPI spec, please follow the steps below:
1. Download the Java JAR (https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.0.0-SNAPSHOT/openapi-generator-cli-4.0.0-20190511.181641-641.jar https://oss.sonatype.org/content/repositories/snapshots/org/...)
2. Rename the JAR as "openapi-generator-cli.jar"
3. Run the following command to generate a Groovy API client for the Petstore API (https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml https://raw.githubusercontent.com/OpenAPITools/openapi-gener...):
Mac/Linux:
- java -jar openapi-generator-cli.jar generate -g groovy -i https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml https://raw.githubusercontent.com/OpenAPITools/openapi-gener... -o /var/tmp/groovy-api-client/
Windows:
- java -jar openapi-generator-cli.jar generate -g groovy -i https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml https://raw.githubusercontent.com/OpenAPITools/openapi-gener... -o C:\tmp\groovy-api-client
Thanks Vincent Devos for his contribution on this (https://github.com/OpenAPITools/openapi-generator/pull/2847 https://github.com/OpenAPITools/openapi-generator/pull/2847)
Best regards,
William