Skip to content

Commit bf26c2a

Browse files
committed
fix after merge of master
1 parent 8dd296a commit bf26c2a

200 files changed

Lines changed: 548 additions & 400 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.20.0-SNAPSHOT
1+
7.21.0-SNAPSHOT
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OpenAPI generated API stub
22

3-
[Spring Framework 6 HTTP Interface](https://docs.spring.io/spring-framework/docs/6.0.0/reference/html/integration.html#rest-http-interface)
3+
[Spring Framework 6.1 HTTP Interface](https://docs.spring.io/spring-framework/docs/6.1.0/reference/html/integration.html#rest-http-interface)
44

55

66
## Overview
@@ -9,13 +9,13 @@ By using the [OpenAPI-Spec](https://openapis.org), you can easily generate an AP
99
This is an example of building API stub interfaces in Java using the Spring framework.
1010

1111
The stubs generated can be used in your existing Spring application for HTTP integration with other REST services
12-
To use auto-generated interfaces you have to create your own configuration which extends default abstract configurator & provide `WebClient` instance via constructor
12+
To use auto-generated interfaces you have to create your own configuration which extends default abstract configurator & provide `RestClient` instance via constructor
1313
```java
1414
@Configuration
1515
public class MyConfiguration extends org.openapitools.configuration.HttpInterfacesAbstractConfigurator {
1616

17-
public MyConfiguration(WebClient myWebClient) { // separately created WebClient instance
18-
super(myWebClient);
17+
public MyConfiguration(RestClient client) {
18+
super(client);
1919
}
2020
}
2121
```

samples/client/petstore/spring-http-interface-bean-validation/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<parent>
1313
<groupId>org.springframework.boot</groupId>
1414
<artifactId>spring-boot-starter-parent</artifactId>
15-
<version>3.1.3</version>
15+
<version>3.3.13</version>
1616
<relativePath/> <!-- lookup parent from repository -->
1717
</parent>
1818

@@ -46,7 +46,7 @@
4646
<dependencies>
4747
<dependency>
4848
<groupId>org.springframework.boot</groupId>
49-
<artifactId>spring-boot-starter-webflux</artifactId>
49+
<artifactId>spring-boot-starter-web</artifactId>
5050
</dependency>
5151
<!-- @Nullable annotation -->
5252
<dependency>
@@ -65,7 +65,7 @@
6565
<dependency>
6666
<groupId>org.openapitools</groupId>
6767
<artifactId>jackson-databind-nullable</artifactId>
68-
<version>0.2.8</version>
68+
<version>0.2.9</version>
6969
</dependency>
7070
<dependency>
7171
<groupId>org.springframework.boot</groupId>

samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT).
2+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.21.0-SNAPSHOT).
33
* https://openapi-generator.tech
44
* Do not edit the class manually.
55
*/
@@ -21,7 +21,7 @@
2121

2222

2323
@Validated
24-
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
24+
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
2525
public interface AnotherFakeApi {
2626

2727
/**

samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT).
2+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.21.0-SNAPSHOT).
33
* https://openapi-generator.tech
44
* Do not edit the class manually.
55
*/
@@ -32,7 +32,7 @@
3232

3333

3434
@Validated
35-
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
35+
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
3636
public interface FakeApi {
3737

3838
/**

samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT).
2+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.21.0-SNAPSHOT).
33
* https://openapi-generator.tech
44
* Do not edit the class manually.
55
*/
@@ -21,7 +21,7 @@
2121

2222

2323
@Validated
24-
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
24+
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
2525
public interface FakeClassnameTags123Api {
2626

2727
/**

samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/PetApi.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT).
2+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.21.0-SNAPSHOT).
33
* https://openapi-generator.tech
44
* Do not edit the class manually.
55
*/
@@ -25,7 +25,7 @@
2525

2626

2727
@Validated
28-
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
28+
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
2929
public interface PetApi {
3030

3131
/**
@@ -62,7 +62,7 @@ ResponseEntity<Void> addPet(
6262
accept = { "application/json" }
6363
)
6464
ResponseEntity<Void> deletePet(
65-
@NotNull @PathVariable("petId") Long petId,
65+
@PathVariable("petId") Long petId,
6666
@RequestHeader(value = "api_key", required = false) @Nullable String apiKey
6767
);
6868

@@ -120,7 +120,7 @@ ResponseEntity<Set<PetDto>> findPetsByTags(
120120
accept = { "application/json", "application/xml" }
121121
)
122122
ResponseEntity<PetDto> getPetById(
123-
@NotNull @PathVariable("petId") Long petId
123+
@PathVariable("petId") Long petId
124124
);
125125

126126

@@ -136,7 +136,7 @@ ResponseEntity<PetDto> getPetById(
136136
accept = { "application/json" }
137137
)
138138
ResponseEntity<ResponseObjectWithDifferentFieldNamesDto> responseObjectDifferentNames(
139-
@NotNull @PathVariable("petId") Long petId
139+
@PathVariable("petId") Long petId
140140
);
141141

142142

@@ -177,7 +177,7 @@ ResponseEntity<Void> updatePet(
177177
contentType = "application/x-www-form-urlencoded"
178178
)
179179
ResponseEntity<Void> updatePetWithForm(
180-
@NotNull @PathVariable("petId") Long petId,
180+
@PathVariable("petId") Long petId,
181181
@Valid @RequestParam(value = "name", required = false) String name,
182182
@Valid @RequestParam(value = "status", required = false) String status
183183
);
@@ -199,7 +199,7 @@ ResponseEntity<Void> updatePetWithForm(
199199
contentType = "multipart/form-data"
200200
)
201201
ResponseEntity<ApiResponseDto> uploadFile(
202-
@NotNull @PathVariable("petId") Long petId,
202+
@PathVariable("petId") Long petId,
203203
@Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata,
204204
@RequestPart(value = "file", required = false) MultipartFile file
205205
);
@@ -221,7 +221,7 @@ ResponseEntity<ApiResponseDto> uploadFile(
221221
contentType = "multipart/form-data"
222222
)
223223
ResponseEntity<ApiResponseDto> uploadFileWithRequiredFile(
224-
@NotNull @PathVariable("petId") Long petId,
224+
@PathVariable("petId") Long petId,
225225
@RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,
226226
@Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata
227227
);

samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/StoreApi.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT).
2+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.21.0-SNAPSHOT).
33
* https://openapi-generator.tech
44
* Do not edit the class manually.
55
*/
@@ -22,7 +22,7 @@
2222

2323

2424
@Validated
25-
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
25+
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
2626
public interface StoreApi {
2727

2828
/**
@@ -39,7 +39,7 @@ public interface StoreApi {
3939
accept = { "application/json" }
4040
)
4141
ResponseEntity<Void> deleteOrder(
42-
@NotNull @PathVariable("order_id") String orderId
42+
@PathVariable("order_id") String orderId
4343
);
4444

4545

@@ -74,7 +74,7 @@ ResponseEntity<Map<String, Integer>> getInventory(
7474
accept = { "application/json", "application/xml" }
7575
)
7676
ResponseEntity<OrderDto> getOrderById(
77-
@NotNull @Min(value = 1L) @Max(value = 5L) @PathVariable("order_id") Long orderId
77+
@Min(value = 1L) @Max(value = 5L) @PathVariable("order_id") Long orderId
7878
);
7979

8080

samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/UserApi.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT).
2+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.21.0-SNAPSHOT).
33
* https://openapi-generator.tech
44
* Do not edit the class manually.
55
*/
@@ -22,7 +22,7 @@
2222

2323

2424
@Validated
25-
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT")
25+
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
2626
public interface UserApi {
2727

2828
/**
@@ -93,7 +93,7 @@ ResponseEntity<Void> createUsersWithListInput(
9393
accept = { "application/json" }
9494
)
9595
ResponseEntity<Void> deleteUser(
96-
@NotNull @PathVariable("username") String username
96+
@PathVariable("username") String username
9797
);
9898

9999

@@ -112,7 +112,7 @@ ResponseEntity<Void> deleteUser(
112112
accept = { "application/json", "application/xml" }
113113
)
114114
ResponseEntity<UserDto> getUserByName(
115-
@NotNull @PathVariable("username") String username
115+
@PathVariable("username") String username
116116
);
117117

118118

@@ -168,7 +168,7 @@ ResponseEntity<Void> logoutUser(
168168
contentType = "application/json"
169169
)
170170
ResponseEntity<Void> updateUser(
171-
@NotNull @PathVariable("username") String username,
171+
@PathVariable("username") String username,
172172
@Valid @RequestBody UserDto userDto
173173
);
174174

samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/configuration/HttpInterfacesAbstractConfigurator.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT).
2+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.21.0-SNAPSHOT).
33
* https://openapi-generator.tech
44
* Do not edit the class manually.
55
*/
@@ -13,51 +13,51 @@
1313
import org.openapitools.api.UserApi;
1414

1515
import org.springframework.context.annotation.Bean;
16-
import org.springframework.web.reactive.function.client.WebClient;
17-
import org.springframework.web.reactive.function.client.support.WebClientAdapter;
16+
import org.springframework.web.client.RestClient;
17+
import org.springframework.web.client.support.RestClientAdapter;
1818
import org.springframework.web.service.invoker.HttpServiceProxyFactory;
1919

2020
public abstract class HttpInterfacesAbstractConfigurator {
2121

22-
private final WebClient webClient;
22+
private final RestClient client;
2323

24-
public HttpInterfacesAbstractConfigurator(final WebClient webClient) {
25-
this.webClient = webClient;
24+
public HttpInterfacesAbstractConfigurator(final RestClient client) {
25+
this.client = client;
2626
}
2727

2828
@Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.anotherFake")
2929
AnotherFakeApi anotherFakeHttpProxy() {
30-
HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build();
30+
HttpServiceProxyFactory factory = HttpServiceProxyFactory.builderFor(RestClientAdapter.create(client)).build();
3131
return factory.createClient(AnotherFakeApi.class);
3232
}
3333

3434
@Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.fake")
3535
FakeApi fakeHttpProxy() {
36-
HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build();
36+
HttpServiceProxyFactory factory = HttpServiceProxyFactory.builderFor(RestClientAdapter.create(client)).build();
3737
return factory.createClient(FakeApi.class);
3838
}
3939

4040
@Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.fakeClassnameTags123")
4141
FakeClassnameTags123Api fakeClassnameTags123HttpProxy() {
42-
HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build();
42+
HttpServiceProxyFactory factory = HttpServiceProxyFactory.builderFor(RestClientAdapter.create(client)).build();
4343
return factory.createClient(FakeClassnameTags123Api.class);
4444
}
4545

4646
@Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.pet")
4747
PetApi petHttpProxy() {
48-
HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build();
48+
HttpServiceProxyFactory factory = HttpServiceProxyFactory.builderFor(RestClientAdapter.create(client)).build();
4949
return factory.createClient(PetApi.class);
5050
}
5151

5252
@Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.store")
5353
StoreApi storeHttpProxy() {
54-
HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build();
54+
HttpServiceProxyFactory factory = HttpServiceProxyFactory.builderFor(RestClientAdapter.create(client)).build();
5555
return factory.createClient(StoreApi.class);
5656
}
5757

5858
@Bean(name = "org.openapitools.configuration.HttpInterfacesAbstractConfigurator.user")
5959
UserApi userHttpProxy() {
60-
HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build();
60+
HttpServiceProxyFactory factory = HttpServiceProxyFactory.builderFor(RestClientAdapter.create(client)).build();
6161
return factory.createClient(UserApi.class);
6262
}
6363

0 commit comments

Comments
 (0)