Skip to content

feat: [OpenAPI] withDefaultHeader on Api classes#1130

Open
rpanackal wants to merge 3 commits intomainfrom
feat/openapi/apache-default-headers
Open

feat: [OpenAPI] withDefaultHeader on Api classes#1130
rpanackal wants to merge 3 commits intomainfrom
feat/openapi/apache-default-headers

Conversation

@rpanackal
Copy link
Copy Markdown
Member

@rpanackal rpanackal commented Mar 30, 2026

Context

SAP/cloud-sdk-java-backlog#ISSUENUMBER.

API enabling users to add custom headers from generated *Api classes.

This is simply alternative to what is presented in #1129

Pro: custom header api directly visible to user without directly instantiating ApiClient instance
Con: Its only the header that is customizable. Any addition customization (eg: query params) -> addition of new api

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Error handling created / updated & covered by the tests above
  • Documentation updated
  • Release notes updated

final TypeReference<OpenApiResponse> localVarReturnType = new TypeReference<OpenApiResponse>() {};
{{/returnType}}

return apiClient.invokeAPI(
Copy link
Copy Markdown
Contributor

@newtork newtork Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Major)
This looks unexpected.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, we would be making an actual ApiClient#invokeAPI call instead of delegating to BaseApi. Did I miss something?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could put the relevant code here. just above (original) apiClient.invokeAPI(

final var mergedHeaderParams = new HashMap<>(defaultHeaders);
mergedHeaderParams.putAll(headerParams);`

Copy link
Copy Markdown
Contributor

@CharlesDuboisSAP CharlesDuboisSAP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer this to #1129

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants