Skip to content

[Java][WebClient|RestClient][20808] add Autowired annotations guard to skip generation when not generating Spring bean #21198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;

{{/useBeanValidation}}
{{#generateClientAsBean}}
import org.springframework.beans.factory.annotation.Autowired;
{{/generateClientAsBean}}
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand Down Expand Up @@ -46,7 +48,9 @@ public class {{classname}} {
this(new ApiClient());
}

{{#generateClientAsBean}}
@Autowired
{{/generateClientAsBean}}
public {{classname}}(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;

{{/useBeanValidation}}
{{#generateClientAsBean}}
import org.springframework.beans.factory.annotation.Autowired;
{{/generateClientAsBean}}
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand Down Expand Up @@ -48,7 +50,9 @@ public class {{classname}} {
this(new ApiClient());
}

{{#generateClientAsBean}}
@Autowired
{{/generateClientAsBean}}
public {{classname}}(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -32,7 +31,6 @@ public AuthApi() {
this(new ApiClient());
}

@Autowired
public AuthApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -36,7 +35,6 @@ public BodyApi() {
this(new ApiClient());
}

@Autowired
public BodyApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -33,7 +32,6 @@ public FormApi() {
this(new ApiClient());
}

@Autowired
public FormApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -33,7 +32,6 @@ public HeaderApi() {
this(new ApiClient());
}

@Autowired
public HeaderApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -33,7 +32,6 @@ public PathApi() {
this(new ApiClient());
}

@Autowired
public PathApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -39,7 +38,6 @@ public QueryApi() {
this(new ApiClient());
}

@Autowired
public QueryApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -33,7 +32,6 @@ public ResourceApi() {
this(new ApiClient());
}

@Autowired
public ResourceApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -35,7 +34,6 @@ public ResourceApi() {
this(new ApiClient());
}

@Autowired
public ResourceApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -33,7 +32,6 @@ public DefaultApi() {
this(new ApiClient());
}

@Autowired
public DefaultApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -33,7 +32,6 @@ public AnotherFakeApi() {
this(new ApiClient());
}

@Autowired
public AnotherFakeApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -33,7 +32,6 @@ public DefaultApi() {
this(new ApiClient());
}

@Autowired
public DefaultApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -47,7 +46,6 @@ public FakeApi() {
this(new ApiClient());
}

@Autowired
public FakeApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -33,7 +32,6 @@ public FakeClassnameTags123Api() {
this(new ApiClient());
}

@Autowired
public FakeClassnameTags123Api(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -36,7 +35,6 @@ public PetApi() {
this(new ApiClient());
}

@Autowired
public PetApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -33,7 +32,6 @@ public StoreApi() {
this(new ApiClient());
}

@Autowired
public StoreApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -34,7 +33,6 @@ public UserApi() {
this(new ApiClient());
}

@Autowired
public UserApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -33,7 +32,6 @@ public AnotherFakeApi() {
this(new ApiClient());
}

@Autowired
public AnotherFakeApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -33,7 +32,6 @@ public DefaultApi() {
this(new ApiClient());
}

@Autowired
public DefaultApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -47,7 +46,6 @@ public FakeApi() {
this(new ApiClient());
}

@Autowired
public FakeApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -33,7 +32,6 @@ public FakeClassnameTags123Api() {
this(new ApiClient());
}

@Autowired
public FakeClassnameTags123Api(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -36,7 +35,6 @@ public PetApi() {
this(new ApiClient());
}

@Autowired
public PetApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Arrays;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
Expand All @@ -33,7 +32,6 @@ public StoreApi() {
this(new ApiClient());
}

@Autowired
public StoreApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
Expand Down
Loading