Skip to content

Commit 075fada

Browse files
authored
#23697 Correctly set the Java version in the README for Vert.x 5 proj… (#23698)
* #23697 Correctly set the Java version in the README for Vert.x 5 projects * #23697 Correctly set the Java version in the README for Vert.x 5 projects
1 parent 60ef743 commit 075fada

3 files changed

Lines changed: 255 additions & 2 deletions

File tree

Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
# {{artifactId}}
2+
3+
{{appName}}
4+
5+
- API version: {{appVersion}}
6+
{{^hideGenerationTimestamp}}
7+
8+
- Build date: {{generatedDate}}
9+
{{/hideGenerationTimestamp}}
10+
11+
- Generator version: {{generatorVersion}}
12+
13+
{{{appDescriptionWithNewLines}}}
14+
15+
{{#infoUrl}}
16+
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
17+
{{/infoUrl}}
18+
19+
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
20+
21+
## Requirements
22+
23+
Building the API client library requires:
24+
25+
{{#useVertx5}}
26+
1. Java 11+
27+
{{/useVertx5}}
28+
{{^useVertx5}}
29+
1. Java 1.8+
30+
{{/useVertx5}}
31+
{{#jersey2}}
32+
2. Maven (3.8.3+)/Gradle (7.2+)
33+
{{/jersey2}}
34+
{{^jersey2}}
35+
2. Maven/Gradle
36+
{{/jersey2}}
37+
38+
## Installation
39+
40+
To install the API client library to your local Maven repository, simply execute:
41+
42+
```shell
43+
mvn clean install
44+
```
45+
46+
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
47+
48+
```shell
49+
mvn clean deploy
50+
```
51+
52+
Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
53+
54+
### Maven users
55+
56+
Add this dependency to your project's POM:
57+
58+
```xml
59+
<dependency>
60+
<groupId>{{{groupId}}}</groupId>
61+
<artifactId>{{{artifactId}}}</artifactId>
62+
<version>{{{artifactVersion}}}</version>
63+
<scope>compile</scope>
64+
</dependency>
65+
```
66+
67+
### Gradle users
68+
69+
Add this dependency to your project's build file:
70+
71+
```groovy
72+
repositories {
73+
mavenCentral() // Needed if the '{{{artifactId}}}' jar has been published to maven central.
74+
mavenLocal() // Needed if the '{{{artifactId}}}' jar has been published to the local maven repo.
75+
}
76+
77+
dependencies {
78+
implementation "{{{groupId}}}:{{{artifactId}}}:{{{artifactVersion}}}"
79+
}
80+
```
81+
82+
### Others
83+
84+
At first generate the JAR by executing:
85+
86+
```shell
87+
mvn clean package
88+
```
89+
90+
Then manually install the following JARs:
91+
92+
- `target/{{{artifactId}}}-{{{artifactVersion}}}.jar`
93+
- `target/lib/*.jar`
94+
95+
{{#jersey2}}
96+
## Usage
97+
98+
To add a HTTP proxy for the API client, use `ClientConfig`:
99+
```java
100+
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}
101+
import org.glassfish.jersey.apache.connector.ApacheConnectorProvider;
102+
import org.glassfish.jersey.client.ClientConfig;
103+
import org.glassfish.jersey.client.ClientProperties;
104+
import {{{invokerPackage}}}.*;
105+
import {{{package}}}.{{{classname}}};
106+
107+
...
108+
109+
ApiClient defaultClient = Configuration.getDefaultApiClient();
110+
ClientConfig clientConfig = defaultClient.getClientConfig();
111+
clientConfig.connectorProvider(new ApacheConnectorProvider());
112+
clientConfig.property(ClientProperties.PROXY_URI, "http://proxy_url_here");
113+
clientConfig.property(ClientProperties.PROXY_USERNAME, "proxy_username");
114+
clientConfig.property(ClientProperties.PROXY_PASSWORD, "proxy_password");
115+
defaultClient.setClientConfig(clientConfig);
116+
117+
{{{classname}}} apiInstance = new {{{classname}}}(defaultClient);
118+
{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
119+
```
120+
121+
{{/jersey2}}
122+
## Getting Started
123+
124+
Please follow the [installation](#installation) instruction and execute the following Java code:
125+
126+
```java
127+
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}
128+
import {{{invokerPackage}}}.*;
129+
import {{{invokerPackage}}}.auth.*;
130+
import {{{modelPackage}}}.*;
131+
import {{{package}}}.{{{classname}}};
132+
133+
public class {{{classname}}}Example {
134+
135+
public static void main(String[] args) {
136+
ApiClient defaultClient = Configuration.getDefaultApiClient();
137+
defaultClient.setBasePath("{{{basePath}}}");
138+
{{#hasAuthMethods}}{{#authMethods}}{{#isBasic}}{{#isBasicBasic}}
139+
// Configure HTTP basic authorization: {{{name}}}
140+
HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}");
141+
{{{name}}}.setUsername("YOUR USERNAME");
142+
{{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}}
143+
// Configure HTTP bearer authorization: {{{name}}}
144+
HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}");
145+
{{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}}
146+
// Configure API key authorization: {{{name}}}
147+
ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}");
148+
{{{name}}}.setApiKey("YOUR API KEY");
149+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
150+
//{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}}
151+
// Configure OAuth2 access token for authorization: {{{name}}}
152+
OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}");
153+
{{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}}{{#isHttpSignature}}
154+
// Configure HTTP signature authorization: {{{name}}}
155+
HttpSignatureAuth {{{name}}} = (HttpSignatureAuth) defaultClient.getAuthentication("{{{name}}}");
156+
// All the HTTP signature parameters below should be customized to your environment.
157+
// Configure the keyId
158+
{{{name}}}.setKeyId("YOUR KEY ID");
159+
// Configure the signature algorithm
160+
{{{name}}}.setSigningAlgorithm(SigningAlgorithm.HS2019);
161+
// Configure the specific cryptographic algorithm
162+
{{{name}}}.setAlgorithm(Algorithm.ECDSA_SHA256);
163+
// Configure the cryptographic algorithm parameters, if applicable
164+
{{{name}}}.setAlgorithmParameterSpec(null);
165+
// Set the cryptographic digest algorithm.
166+
{{{name}}}.setDigestAlgorithm("SHA-256");
167+
// Set the HTTP headers that should be included in the HTTP signature.
168+
{{{name}}}.setHeaders(Arrays.asList("date", "host"));
169+
// Set the private key used to sign the HTTP messages
170+
{{{name}}}.setPrivateKey();{{/isHttpSignature}}
171+
{{/authMethods}}
172+
{{/hasAuthMethods}}
173+
174+
{{{classname}}} apiInstance = new {{{classname}}}(defaultClient);
175+
{{#allParams}}
176+
{{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
177+
{{/allParams}}
178+
try {
179+
{{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}}
180+
System.out.println(result);{{/returnType}}
181+
} catch (ApiException e) {
182+
System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}");
183+
System.err.println("Status code: " + e.getCode());
184+
System.err.println("Reason: " + e.getResponseBody());
185+
System.err.println("Response headers: " + e.getResponseHeaders());
186+
e.printStackTrace();
187+
}
188+
}
189+
}
190+
{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
191+
```
192+
193+
## Documentation for API Endpoints
194+
195+
All URIs are relative to *{{basePath}}*
196+
197+
Class | Method | HTTP request | Description
198+
------------ | ------------- | ------------- | -------------
199+
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}}
200+
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
201+
202+
## Documentation for Models
203+
204+
{{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md)
205+
{{/model}}{{/models}}
206+
207+
<a id="documentation-for-authorization"></a>
208+
## Documentation for Authorization
209+
210+
{{^authMethods}}Endpoints do not require authorization.{{/authMethods}}
211+
{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}}
212+
{{#authMethods}}
213+
<a id="{{name}}"></a>
214+
### {{name}}
215+
216+
{{#isApiKey}}
217+
218+
- **Type**: API key
219+
- **API key parameter name**: {{keyParamName}}
220+
- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
221+
{{/isApiKey}}
222+
{{#isBasicBasic}}
223+
224+
- **Type**: HTTP basic authentication
225+
{{/isBasicBasic}}
226+
{{#isBasicBearer}}
227+
228+
- **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}
229+
{{/isBasicBearer}}
230+
{{#isHttpSignature}}
231+
232+
- **Type**: HTTP signature authentication
233+
{{/isHttpSignature}}
234+
{{#isOAuth}}
235+
236+
- **Type**: OAuth
237+
- **Flow**: {{flow}}
238+
- **Authorization URL**: {{authorizationUrl}}
239+
- **Scopes**: {{^scopes}}N/A{{/scopes}}
240+
{{#scopes}} - {{scope}}: {{description}}
241+
{{/scopes}}
242+
{{/isOAuth}}
243+
244+
{{/authMethods}}
245+
246+
## Recommendation
247+
248+
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
249+
250+
## Author
251+
252+
{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}}
253+
{{/-last}}{{/apis}}{{/apiInfo}}

samples/client/petstore/java/vertx5-supportVertxFuture/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod
1515

1616
Building the API client library requires:
1717

18-
1. Java 1.8+
18+
1. Java 11+
1919
2. Maven/Gradle
2020

2121
## Installation

samples/client/petstore/java/vertx5/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod
1515

1616
Building the API client library requires:
1717

18-
1. Java 1.8+
18+
1. Java 11+
1919
2. Maven/Gradle
2020

2121
## Installation

0 commit comments

Comments
 (0)