TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Auto-Generate R SDK for REST APIs Using OpenAPI Generator

3 pointsby wing328hkabout 6 years ago
To generate R SDK or API client for REST API, one can easily do so with the help of OpenAPI Generator (<a href="https:&#x2F;&#x2F;github.com&#x2F;OpenAPITools&#x2F;openapi-generator" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;OpenAPITools&#x2F;openapi-generator</a>). Here are 3 steps to generate the SDK&#x2F;client:<p>1. Download the Java JAR (<a href="https:&#x2F;&#x2F;oss.sonatype.org&#x2F;content&#x2F;repositories&#x2F;snapshots&#x2F;org&#x2F;openapitools&#x2F;openapi-generator-cli&#x2F;4.0.0-SNAPSHOT&#x2F;openapi-generator-cli-4.0.0-20190325.135215-449.jar" rel="nofollow">https:&#x2F;&#x2F;oss.sonatype.org&#x2F;content&#x2F;repositories&#x2F;snapshots&#x2F;org&#x2F;...</a>)<p>2. Rename the JAR as &quot;openapi-generator.jar&quot;<p>3. Run the following command to generate R SDK for Petstore API (<a href="https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;OpenAPITools&#x2F;openapi-generator&#x2F;master&#x2F;modules&#x2F;openapi-generator&#x2F;src&#x2F;test&#x2F;resources&#x2F;2_0&#x2F;petstore.yaml" rel="nofollow">https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;OpenAPITools&#x2F;openapi-gener...</a>):<p>Mac&#x2F;Linux: - java -jar openapi-generator.jar generate -g r -i <a href="https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;OpenAPITools&#x2F;openapi-generator&#x2F;master&#x2F;modules&#x2F;openapi-generator&#x2F;src&#x2F;test&#x2F;resources&#x2F;2_0&#x2F;petstore.yaml" rel="nofollow">https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;OpenAPITools&#x2F;openapi-gener...</a> -o &#x2F;tmp&#x2F;petstore&#x2F;<p>Windows: - java -jar openapi-generator.jar generate -g r -i <a href="https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;OpenAPITools&#x2F;openapi-generator&#x2F;master&#x2F;modules&#x2F;openapi-generator&#x2F;src&#x2F;test&#x2F;resources&#x2F;2_0&#x2F;petstore.yaml" rel="nofollow">https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;OpenAPITools&#x2F;openapi-gener...</a> -o C:\tmp\petstore<p>The auto-generated documentation (README.md, how to install, etc) can be found in the &quot;docs&quot; folder.<p>Please give it a try and let me know if you&#x27;ve any feedback&#x2F;question.

no comments

no comments