Skip to content

Commit

Permalink
[Java/Spring] Revert to fully qualified import for org.springframewor…
Browse files Browse the repository at this point in the history
…k.core.io.Resource (#11461)

* Revert to fully qualified import for org.springframework.core.io.Resource

* Generate Samples
  • Loading branch information
cachescrubber authored Jan 31, 2022
1 parent ed14ce4 commit b261b29
Show file tree
Hide file tree
Showing 106 changed files with 100 additions and 204 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,8 @@ public void processOpts() {
}
additionalProperties.put(UNHANDLED_EXCEPTION_HANDLING, this.isUnhandledException());

typeMapping.put("file", "Resource");
importMapping.put("Resource", "org.springframework.core.io.Resource");
typeMapping.put("file", "org.springframework.core.io.Resource");
importMapping.put("org.springframework.core.io.Resource", "org.springframework.core.io.Resource");
importMapping.put("Pageable", "org.springframework.data.domain.Pageable");
importMapping.put("DateTimeFormat", "org.springframework.format.annotation.DateTimeFormat");
importMapping.put("ApiIgnore", "springfox.documentation.annotations.ApiIgnore");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -792,14 +792,14 @@ public void testConfigFileGeneration() {
public void testTypeMappings() {
final SpringCodegen codegen = new SpringCodegen();
codegen.processOpts();
Assert.assertEquals(codegen.typeMapping().get("file"), "Resource");
Assert.assertEquals(codegen.typeMapping().get("file"), "org.springframework.core.io.Resource");
}

@Test
public void testImportMappings() {
final SpringCodegen codegen = new SpringCodegen();
codegen.processOpts();
Assert.assertEquals(codegen.importMapping().get("Resource"), "org.springframework.core.io.Resource");
Assert.assertEquals(codegen.importMapping().get("org.springframework.core.io.Resource"), "org.springframework.core.io.Resource");
Assert.assertEquals(codegen.importMapping().get("Pageable"), "org.springframework.data.domain.Pageable");
Assert.assertEquals(codegen.importMapping().get("DateTimeFormat"), "org.springframework.format.annotation.DateTimeFormat");
Assert.assertEquals(codegen.importMapping().get("ApiIgnore"), "springfox.documentation.annotations.ApiIgnore");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.Pet;
import org.springframework.core.io.Resource;
import io.swagger.annotations.*;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.openapitools.model.ModelApiResponse;
import org.springframework.data.domain.Pageable;
import org.openapitools.model.Pet;
import org.springframework.core.io.Resource;
import io.swagger.annotations.*;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.Pet;
import org.springframework.core.io.Resource;
import io.swagger.annotations.*;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.Pet;
import org.springframework.core.io.Resource;
import io.swagger.annotations.*;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.Pet;
import org.springframework.core.io.Resource;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import java.util.Map;
import java.time.OffsetDateTime;
import org.openapitools.model.OuterComposite;
import org.springframework.core.io.Resource;
import org.openapitools.model.User;
import org.openapitools.model.XmlItem;
import io.swagger.v3.oas.annotations.Operation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.Pet;
import org.springframework.core.io.Resource;
import java.util.Set;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.time.OffsetDateTime;
import java.util.Arrays;
import java.util.UUID;
import org.springframework.core.io.Resource;
import org.springframework.format.annotation.DateTimeFormat;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
Expand Down Expand Up @@ -53,7 +52,7 @@ public class FormatTest {
private byte[] _byte;

@JsonProperty("binary")
private Resource binary;
private org.springframework.core.io.Resource binary;

@JsonProperty("date")
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
Expand Down Expand Up @@ -234,7 +233,7 @@ public void setByte(byte[] _byte) {
this._byte = _byte;
}

public FormatTest binary(Resource binary) {
public FormatTest binary(org.springframework.core.io.Resource binary) {
this.binary = binary;
return this;
}
Expand All @@ -245,11 +244,11 @@ public FormatTest binary(Resource binary) {
*/
@Valid
@Schema(name = "binary", required = false)
public Resource getBinary() {
public org.springframework.core.io.Resource getBinary() {
return binary;
}

public void setBinary(Resource binary) {
public void setBinary(org.springframework.core.io.Resource binary) {
this.binary = binary;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.springframework.data.domain.Pageable;
import org.springdoc.api.annotations.ParameterObject;
import org.openapitools.model.Pet;
import org.springframework.core.io.Resource;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.Pet;
import org.springframework.core.io.Resource;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.Pet;
import org.springframework.core.io.Resource;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.Pet;
import org.springframework.core.io.Resource;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.openapitools.model.ModelApiResponse;
import org.threeten.bp.OffsetDateTime;
import org.openapitools.model.OuterComposite;
import org.springframework.core.io.Resource;
import org.openapitools.model.User;
import org.openapitools.model.XmlItem;
import io.swagger.v3.oas.annotations.Operation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.openapitools.model.ModelApiResponse;
import org.threeten.bp.OffsetDateTime;
import org.openapitools.model.OuterComposite;
import org.springframework.core.io.Resource;
import org.openapitools.model.User;
import org.openapitools.model.XmlItem;
import io.swagger.v3.oas.annotations.Operation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.Pet;
import org.springframework.core.io.Resource;
import java.util.Set;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.Pet;
import org.springframework.core.io.Resource;
import java.util.Set;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.UUID;
import org.springframework.core.io.Resource;
import org.springframework.format.annotation.DateTimeFormat;
import org.threeten.bp.LocalDate;
import org.threeten.bp.OffsetDateTime;
Expand Down Expand Up @@ -51,7 +50,7 @@ public class FormatTest {
private byte[] _byte;

@JsonProperty("binary")
private Resource binary;
private org.springframework.core.io.Resource binary;

@JsonProperty("date")
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
Expand Down Expand Up @@ -232,7 +231,7 @@ public void setByte(byte[] _byte) {
this._byte = _byte;
}

public FormatTest binary(Resource binary) {
public FormatTest binary(org.springframework.core.io.Resource binary) {
this.binary = binary;
return this;
}
Expand All @@ -243,11 +242,11 @@ public FormatTest binary(Resource binary) {
*/
@Valid
@Schema(name = "binary", required = false)
public Resource getBinary() {
public org.springframework.core.io.Resource getBinary() {
return binary;
}

public void setBinary(Resource binary) {
public void setBinary(org.springframework.core.io.Resource binary) {
this.binary = binary;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.openapitools.model.ModelApiResponse;
import java.time.OffsetDateTime;
import org.openapitools.model.OuterComposite;
import org.springframework.core.io.Resource;
import org.openapitools.model.User;
import org.openapitools.model.XmlItem;
import io.swagger.v3.oas.annotations.Operation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.openapitools.model.ModelApiResponse;
import java.time.OffsetDateTime;
import org.openapitools.model.OuterComposite;
import org.springframework.core.io.Resource;
import org.openapitools.model.User;
import org.openapitools.model.XmlItem;
import org.springframework.http.HttpStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.Pet;
import org.springframework.core.io.Resource;
import java.util.Set;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.Pet;
import org.springframework.core.io.Resource;
import java.util.Set;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.time.OffsetDateTime;
import java.util.Arrays;
import java.util.UUID;
import org.springframework.core.io.Resource;
import org.springframework.format.annotation.DateTimeFormat;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
Expand Down Expand Up @@ -53,7 +52,7 @@ public class FormatTest {
private byte[] _byte;

@JsonProperty("binary")
private Resource binary;
private org.springframework.core.io.Resource binary;

@JsonProperty("date")
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
Expand Down Expand Up @@ -234,7 +233,7 @@ public void setByte(byte[] _byte) {
this._byte = _byte;
}

public FormatTest binary(Resource binary) {
public FormatTest binary(org.springframework.core.io.Resource binary) {
this.binary = binary;
return this;
}
Expand All @@ -245,11 +244,11 @@ public FormatTest binary(Resource binary) {
*/
@Valid
@Schema(name = "binary", required = false)
public Resource getBinary() {
public org.springframework.core.io.Resource getBinary() {
return binary;
}

public void setBinary(Resource binary) {
public void setBinary(org.springframework.core.io.Resource binary) {
this.binary = binary;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.openapitools.model.ModelApiResponse;
import java.time.OffsetDateTime;
import org.openapitools.model.OuterComposite;
import org.springframework.core.io.Resource;
import org.openapitools.model.User;
import org.openapitools.model.XmlItem;
import io.swagger.v3.oas.annotations.Operation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.Pet;
import org.springframework.core.io.Resource;
import java.util.Set;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.time.OffsetDateTime;
import java.util.Arrays;
import java.util.UUID;
import org.springframework.core.io.Resource;
import org.springframework.format.annotation.DateTimeFormat;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
Expand Down Expand Up @@ -53,7 +52,7 @@ public class FormatTest {
private byte[] _byte;

@JsonProperty("binary")
private Resource binary;
private org.springframework.core.io.Resource binary;

@JsonProperty("date")
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
Expand Down Expand Up @@ -234,7 +233,7 @@ public void setByte(byte[] _byte) {
this._byte = _byte;
}

public FormatTest binary(Resource binary) {
public FormatTest binary(org.springframework.core.io.Resource binary) {
this.binary = binary;
return this;
}
Expand All @@ -245,11 +244,11 @@ public FormatTest binary(Resource binary) {
*/
@Valid
@Schema(name = "binary", required = false)
public Resource getBinary() {
public org.springframework.core.io.Resource getBinary() {
return binary;
}

public void setBinary(Resource binary) {
public void setBinary(org.springframework.core.io.Resource binary) {
this.binary = binary;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.openapitools.model.ModelApiResponse;
import java.time.OffsetDateTime;
import org.openapitools.model.OuterComposite;
import org.springframework.core.io.Resource;
import org.openapitools.model.User;
import org.openapitools.model.XmlItem;
import io.swagger.v3.oas.annotations.Operation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.openapitools.model.ModelApiResponse;
import java.time.OffsetDateTime;
import org.openapitools.model.OuterComposite;
import org.springframework.core.io.Resource;
import org.openapitools.model.User;
import org.openapitools.model.XmlItem;
import org.springframework.http.HttpStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.Pet;
import org.springframework.core.io.Resource;
import java.util.Set;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.Pet;
import org.springframework.core.io.Resource;
import java.util.Set;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
Expand Down
Loading

0 comments on commit b261b29

Please sign in to comment.