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.

OpenAPI Generator Now Supports Java 11 Native HTTP Client

5 pointsby wing328hkalmost 6 years ago
We&#x27;ve added Java 11 Native HTTP client (https:&#x2F;&#x2F;openjdk.java.net&#x2F;groups&#x2F;net&#x2F;httpclient&#x2F;intro.html) support to OpenAPI Generator (https:&#x2F;&#x2F;github.com&#x2F;OpenAPITools&#x2F;openapi-generator). To generate the Java API client (Java 11 HTTP Client) given an OpenAPI&#x2F;Swagger specification file, please follow 3 simple steps below:<p>1. Download the Java JAR (https:&#x2F;&#x2F;oss.sonatype.org&#x2F;content&#x2F;repositories&#x2F;snapshots&#x2F;org&#x2F;openapitools&#x2F;openapi-generator-cli&#x2F;4.1.0-SNAPSHOT&#x2F;openapi-generator-cli-4.1.0-20190727.141928-68.jar)<p>2. Rename the JAR as &quot;openapi-generator-cli.jar&quot;<p>3. Run the following command to generate a Java API client for the Petstore API (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):<p>Mac&#x2F;Linux:<p>&gt; java -jar openapi-generator-cli.jar generate -g java -i 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 -o &#x2F;var&#x2F;tmp&#x2F;java11&#x2F; --additional-properties library=native<p>Windows:<p>&gt; java -jar openapi-generator-cli.jar generate -g java -i 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 -o C:\tmp\java11 --additional-properties library=native<p>Thanks Benjamin (https:&#x2F;&#x2F;github.com&#x2F;bbdouglas) from Yelp (http:&#x2F;&#x2F;yelp.com&#x2F;) for contributing the enhancement (https:&#x2F;&#x2F;github.com&#x2F;OpenAPITools&#x2F;openapi-generator&#x2F;pull&#x2F;3434).

no comments

no comments