Skip to content

Commit 16e3d53

Browse files
committed
feat: set partner-transaction-id as transaction-id header
1 parent f7612fa commit 16e3d53

File tree

2 files changed

+27
-2
lines changed
  • customizations
    • core/src/main/kotlin/com/expediagroup/sdk/core/constant
    • generator/openapi/src/main/resources/templates/expediagroup-sdk

2 files changed

+27
-2
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (C) 2022 Expedia, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.expediagroup.sdk.core.constant
17+
18+
internal object HeaderKey {
19+
const val PAGINATION_TOTAL_RESULTS = "pagination-total-results"
20+
21+
const val LINK = "link"
22+
23+
const val TRANSACTION_ID = "Partner-Transaction-Id"
24+
25+
const val X_SDK_TITLE = "x-sdk-title"
26+
}

customizations/generator/openapi/src/main/resources/templates/expediagroup-sdk/client.mustache

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ class {{clientClassname}}Client private constructor(clientConfiguration: XapClie
4848
}
4949

5050
val extraHeaders = buildMap {
51-
put(HeaderKey.TRANSACTION_ID, operation.transactionId.dequeue().toString())
5251
put("key", configurationProvider.key ?: "")
5352
}
5453

@@ -145,4 +144,4 @@ class {{clientClassname}}Client private constructor(clientConfiguration: XapClie
145144
{{>client/paginatorMethods}}
146145
{{/isPaginatable}}
147146
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
148-
}
147+
}

0 commit comments

Comments
 (0)