Skip to content

Commit b261b29

Browse files
[Java/Spring] Revert to fully qualified import for org.springframework.core.io.Resource (#11461)
* Revert to fully qualified import for org.springframework.core.io.Resource * Generate Samples
1 parent ed14ce4 commit b261b29

File tree

106 files changed

+100
-204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+100
-204
lines changed

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,8 @@ public void processOpts() {
404404
}
405405
additionalProperties.put(UNHANDLED_EXCEPTION_HANDLING, this.isUnhandledException());
406406

407-
typeMapping.put("file", "Resource");
408-
importMapping.put("Resource", "org.springframework.core.io.Resource");
407+
typeMapping.put("file", "org.springframework.core.io.Resource");
408+
importMapping.put("org.springframework.core.io.Resource", "org.springframework.core.io.Resource");
409409
importMapping.put("Pageable", "org.springframework.data.domain.Pageable");
410410
importMapping.put("DateTimeFormat", "org.springframework.format.annotation.DateTimeFormat");
411411
importMapping.put("ApiIgnore", "springfox.documentation.annotations.ApiIgnore");

modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,14 +792,14 @@ public void testConfigFileGeneration() {
792792
public void testTypeMappings() {
793793
final SpringCodegen codegen = new SpringCodegen();
794794
codegen.processOpts();
795-
Assert.assertEquals(codegen.typeMapping().get("file"), "Resource");
795+
Assert.assertEquals(codegen.typeMapping().get("file"), "org.springframework.core.io.Resource");
796796
}
797797

798798
@Test
799799
public void testImportMappings() {
800800
final SpringCodegen codegen = new SpringCodegen();
801801
codegen.processOpts();
802-
Assert.assertEquals(codegen.importMapping().get("Resource"), "org.springframework.core.io.Resource");
802+
Assert.assertEquals(codegen.importMapping().get("org.springframework.core.io.Resource"), "org.springframework.core.io.Resource");
803803
Assert.assertEquals(codegen.importMapping().get("Pageable"), "org.springframework.data.domain.Pageable");
804804
Assert.assertEquals(codegen.importMapping().get("DateTimeFormat"), "org.springframework.format.annotation.DateTimeFormat");
805805
Assert.assertEquals(codegen.importMapping().get("ApiIgnore"), "springfox.documentation.annotations.ApiIgnore");

samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import org.openapitools.model.ModelApiResponse;
99
import org.openapitools.model.Pet;
10-
import org.springframework.core.io.Resource;
1110
import io.swagger.annotations.*;
1211
import org.springframework.http.HttpStatus;
1312
import org.springframework.http.MediaType;

samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import org.openapitools.model.ModelApiResponse;
1010
import org.springframework.data.domain.Pageable;
1111
import org.openapitools.model.Pet;
12-
import org.springframework.core.io.Resource;
1312
import io.swagger.annotations.*;
1413
import org.springframework.http.HttpStatus;
1514
import org.springframework.http.MediaType;

samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import org.openapitools.model.ModelApiResponse;
99
import org.openapitools.model.Pet;
10-
import org.springframework.core.io.Resource;
1110
import io.swagger.annotations.*;
1211
import org.springframework.http.HttpStatus;
1312
import org.springframework.http.MediaType;

samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import org.openapitools.model.ModelApiResponse;
99
import org.openapitools.model.Pet;
10-
import org.springframework.core.io.Resource;
1110
import io.swagger.annotations.*;
1211
import org.springframework.http.HttpStatus;
1312
import org.springframework.http.MediaType;

samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import org.openapitools.model.ModelApiResponse;
99
import org.openapitools.model.Pet;
10-
import org.springframework.core.io.Resource;
1110
import io.swagger.v3.oas.annotations.Operation;
1211
import io.swagger.v3.oas.annotations.Parameter;
1312
import io.swagger.v3.oas.annotations.Parameters;

samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import java.util.Map;
1414
import java.time.OffsetDateTime;
1515
import org.openapitools.model.OuterComposite;
16-
import org.springframework.core.io.Resource;
1716
import org.openapitools.model.User;
1817
import org.openapitools.model.XmlItem;
1918
import io.swagger.v3.oas.annotations.Operation;

samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import org.openapitools.model.ModelApiResponse;
99
import org.openapitools.model.Pet;
10-
import org.springframework.core.io.Resource;
1110
import java.util.Set;
1211
import io.swagger.v3.oas.annotations.Operation;
1312
import io.swagger.v3.oas.annotations.Parameter;

samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import java.time.OffsetDateTime;
1010
import java.util.Arrays;
1111
import java.util.UUID;
12-
import org.springframework.core.io.Resource;
1312
import org.springframework.format.annotation.DateTimeFormat;
1413
import org.openapitools.jackson.nullable.JsonNullable;
1514
import java.time.OffsetDateTime;
@@ -53,7 +52,7 @@ public class FormatTest {
5352
private byte[] _byte;
5453

5554
@JsonProperty("binary")
56-
private Resource binary;
55+
private org.springframework.core.io.Resource binary;
5756

5857
@JsonProperty("date")
5958
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
@@ -234,7 +233,7 @@ public void setByte(byte[] _byte) {
234233
this._byte = _byte;
235234
}
236235

237-
public FormatTest binary(Resource binary) {
236+
public FormatTest binary(org.springframework.core.io.Resource binary) {
238237
this.binary = binary;
239238
return this;
240239
}
@@ -245,11 +244,11 @@ public FormatTest binary(Resource binary) {
245244
*/
246245
@Valid
247246
@Schema(name = "binary", required = false)
248-
public Resource getBinary() {
247+
public org.springframework.core.io.Resource getBinary() {
249248
return binary;
250249
}
251250

252-
public void setBinary(Resource binary) {
251+
public void setBinary(org.springframework.core.io.Resource binary) {
253252
this.binary = binary;
254253
}
255254

0 commit comments

Comments
 (0)