Skip to content

Commit

Permalink
fix: perform the correct null check on headers (#3571)
Browse files Browse the repository at this point in the history
armandobelardo authored May 8, 2024
1 parent 09219e7 commit 62fc4a2
Showing 5 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions generators/java/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.8.11] - 2024-05-08

- Fix: Corrects the fix in 0.8.10 to check null value as opposed to a .isPresent check, given the header is not `Optional`, it's always `String`

## [0.8.10] - 2024-05-08

- Fix: Fixes regression from 0.8.8, headers are no longer added to the header map unless they are non-null.
2 changes: 1 addition & 1 deletion generators/java/sdk/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.10
0.8.11
Original file line number Diff line number Diff line change
@@ -389,7 +389,7 @@ public Void visitHeaderBase(HeaderAuthScheme header, Boolean respectMandatoryAut
// If the header is optional, wrap the add in a presence check so it does not get added unless it's non-null
if (shouldWrapInConditional) {
maybeConditionalAdditionFlow = this.buildMethod
.beginControlFlow("if ($L.isPresent())", fieldName);
.beginControlFlow("if ($L != null)", fieldName);
}

if (header.getPrefix().isPresent()) {

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 62fc4a2

Please sign in to comment.