Skip to content

Commit

Permalink
Generated methode ApiClient.parameterToPairs failed to handle empty c…
Browse files Browse the repository at this point in the history
…ollections #17460 (#17463)

* #17460 add missing empty collection check

* generate samples
  • Loading branch information
conleos-hoppermann authored Jan 9, 2024
1 parent 90f3b24 commit 8bab0ce
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
List<Pair> params = new ArrayList<Pair>();
// preconditions
if (name == null || name.isEmpty() || value == null) {
if (name == null || name.isEmpty() || value == null || value.isEmpty()) {
return params;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
List<Pair> params = new ArrayList<Pair>();
// preconditions
if (name == null || name.isEmpty() || value == null) {
if (name == null || name.isEmpty() || value == null || value.isEmpty()) {
return params;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ public class ApiClient {
List<Pair> params = new ArrayList<Pair>();
// preconditions
if (param == null || param.getName() == null || param.getName().isEmpty() || value == null) {
if (param == null || param.getName() == null || param.getName().isEmpty() || value == null || value.isEmpty()) {
return params;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
List<Pair> params = new ArrayList<Pair>();
// preconditions
if (name == null || name.isEmpty() || value == null) {
if (name == null || name.isEmpty() || value == null || value.isEmpty()) {
return params;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ public List<Pair> parameterToPairs(String collectionFormat, String name, Collect
List<Pair> params = new ArrayList<Pair>();

// preconditions
if (name == null || name.isEmpty() || value == null) {
if (name == null || name.isEmpty() || value == null || value.isEmpty()) {
return params;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ public List<Pair> parameterToPairs(String collectionFormat, String name, Collect
List<Pair> params = new ArrayList<Pair>();

// preconditions
if (name == null || name.isEmpty() || value == null) {
if (name == null || name.isEmpty() || value == null || value.isEmpty()) {
return params;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ public List<Pair> parameterToPairs(Parameter param, Collection value) {
List<Pair> params = new ArrayList<Pair>();

// preconditions
if (param == null || param.getName() == null || param.getName().isEmpty() || value == null) {
if (param == null || param.getName() == null || param.getName().isEmpty() || value == null || value.isEmpty()) {
return params;
}

Expand Down

0 comments on commit 8bab0ce

Please sign in to comment.