Skip to content

Commit b26b680

Browse files
authored
fix(sidekick/swift): no escaping for GateExpression (#6829)
When `GateExpression` include an `&&` the generated code for `{{Codec.GateExpression}}` includes an `&&`. With this PR, we use triple braces to avoid the HTML escaping.
1 parent 773c487 commit b26b680

6 files changed

Lines changed: 6 additions & 6 deletions

File tree

internal/sidekick/swift/annotate_enum.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (ann *enumAnnotations) IsGated() bool {
5959
// In the generated code this is used as:
6060
//
6161
// ```
62-
// #if {{GateExpression}}
62+
// #if {{{GateExpression}}}
6363
// ... all the normal code ...
6464
// #endif
6565
// ```

internal/sidekick/swift/annotate_message.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (ann *messageAnnotations) IsGated() bool {
9191
// In the generated code this is used as:
9292
//
9393
// ```
94-
// #if {{GateExpression}}
94+
// #if {{{GateExpression}}}
9595
// ... all the normal code ...
9696
// #endif
9797
// ```

internal/sidekick/swift/templates/common/enum_file.swift.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ limitations under the License.
2121
{{/Codec.BoilerPlate}}
2222

2323
{{#Codec.IsGated}}
24-
#if {{Codec.GateExpression}}
24+
#if {{{Codec.GateExpression}}}
2525
{{/Codec.IsGated}}
2626
import Foundation
2727

internal/sidekick/swift/templates/common/message_file.swift.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ limitations under the License.
2121
{{/Codec.Model.BoilerPlate}}
2222

2323
{{#Codec.IsGated}}
24-
#if {{Codec.GateExpression}}
24+
#if {{{Codec.GateExpression}}}
2525
{{/Codec.IsGated}}
2626
import Foundation
2727
{{#Codec.MessageImports}}

internal/sidekick/swift/templates/common/placeholder_file.swift.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ limitations under the License.
2121
{{/Codec.Model.BoilerPlate}}
2222

2323
{{#Codec.IsGated}}
24-
#if {{Codec.GateExpression}}
24+
#if {{{Codec.GateExpression}}}
2525
{{/Codec.IsGated}}
2626
import Foundation
2727
{{#Codec.MessageImports}}

internal/sidekick/swift/templates/convert/convert_enum_file.swift.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ limitations under the License.
2121
{{/Codec.BoilerPlate}}
2222

2323
{{#Codec.IsGated}}
24-
#if {{Codec.GateExpression}}
24+
#if {{{Codec.GateExpression}}}
2525
{{/Codec.IsGated}}
2626
import Foundation
2727
import GoogleCloudGax

0 commit comments

Comments
 (0)