-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better constructor for generated clients (Cloud SDK 5.14.0 update) #148
Better constructor for generated clients (Cloud SDK 5.14.0 update) #148
Conversation
Bumps the production-minor-patch group with 3 updates: com.sap.cloud.sdk:sdk-bom, com.sap.cloud.sdk.datamodel:openapi-generator-maven-plugin and [com.puppycrawl.tools:checkstyle](/~https://github.com/checkstyle/checkstyle). Updates `com.sap.cloud.sdk:sdk-bom` from 5.13.0 to 5.14.0 Updates `com.sap.cloud.sdk.datamodel:openapi-generator-maven-plugin` from 5.13.0 to 5.14.0 Updates `com.puppycrawl.tools:checkstyle` from 10.20.0 to 10.20.1 - [Release notes](/~https://github.com/checkstyle/checkstyle/releases) - [Commits](checkstyle/checkstyle@checkstyle-10.20.0...checkstyle-10.20.1) --- updated-dependencies: - dependency-name: com.sap.cloud.sdk:sdk-bom dependency-type: direct:production update-type: version-update:semver-minor dependency-group: production-minor-patch - dependency-name: com.sap.cloud.sdk.datamodel:openapi-generator-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: production-minor-patch - dependency-name: com.puppycrawl.tools:checkstyle dependency-type: direct:production update-type: version-update:semver-patch dependency-group: production-minor-patch ... Signed-off-by: dependabot[bot] <support@github.com>
@@ -27,7 +27,7 @@ | |||
<rule ref="category/java/design.xml/AvoidThrowingRawExceptionTypes"> | |||
<priority>3</priority> | |||
</rule> | |||
<rule ref="category/java/errorprone.xml/NonCaseLabelInSwitchStatement"> | |||
<rule ref="category/java/errorprone.xml/NonCaseLabelInSwitch"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### _"How to add a custom header to AI Core requests?"_ | ||
|
||
To add a header to AI Core requests, use the following code: | ||
|
||
```java | ||
ApiClient client = new AiCoreService().client().addDefaultHeader("header-key", "header-value"); | ||
DeploymentApi api = new DeploymentApi(client); | ||
``` | ||
|
||
For more customization, creating a [HeaderProvider](https://sap.github.io/cloud-sdk/docs/java/features/connectivity/http-destinations#about-headerproviders) is also possible. | ||
Create a [HeaderProvider](https://sap.github.io/cloud-sdk/docs/java/features/connectivity/http-destinations#about-headerproviders). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be improved, maybe by overriding getApiClient?
@@ -182,6 +182,7 @@ | |||
<removeOperationIdPrefix>true</removeOperationIdPrefix> | |||
<removeOperationIdPrefixDelimiter>\.</removeOperationIdPrefixDelimiter> | |||
<removeOperationIdPrefixCount>3</removeOperationIdPrefixCount> | |||
<aiSdkConstructor>true</aiSdkConstructor> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New Cloud SDK 5.14.0 feature that changes all generated client constructors
val logs = | ||
new DeploymentApi(client.addDefaultHeader("Ai-Resource-Group", "default")) | ||
.getLogs("d19b998f347341aa"); | ||
val logs = new DeploymentApi(aiCoreService).getLogs("d19b998f347341aa"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix is now broken
@@ -86,7 +86,7 @@ Refer to the [DeploymentController.java](../../sample-code/spring-app/src/main/j | |||
AiDeploymentCreationResponse deployment; // provided | |||
String deploymentId = deployment.getId(); | |||
|
|||
var api = new DeploymentApi(new AiCoreService().client()); | |||
var api = new DeploymentApi(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User experience improvement that the new constructor allows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Bumps the production-minor-patch group with 3 updates: com.sap.cloud.sdk:sdk-bom, com.sap.cloud.sdk.datamodel:openapi-generator-maven-plugin and com.puppycrawl.tools:checkstyle.
Updates
com.sap.cloud.sdk:sdk-bom
from 5.13.0 to 5.14.0Updates
com.sap.cloud.sdk.datamodel:openapi-generator-maven-plugin
from 5.13.0 to 5.14.0Updates
com.puppycrawl.tools:checkstyle
from 10.20.0 to 10.20.1Release notes
Sourced from com.puppycrawl.tools:checkstyle's releases.
Commits
892800d
[maven-release-plugin] prepare release checkstyle-10.20.19a03ea8
doc: release notes for 10.20.1aef0bf1
Issue #13345: Enabled example tests for DefaultComesLastc4eaaba
Issue #14631: Updated JAVADOC_INLINE_TAG_START of JavadocTokenTypes to new AS...c2a03ae
Issue #13345: Enable examples tests for IllegalInstantiationCheckf75123e
Issue #15851: suppress LeftCurlyNl for switch expressions3dc2a3d
Issue #13345: Enable examples tests for IllegalCatchCheck2a843c0
Issue #13345: Enabled example tests for TrailingCommentCheck3015216
Issue #13345: Enable examples tests for StringLiteralEqualityCheckaadc377
Issue #14625: fix noinspectionreason for TestMethodWithoutAssertionDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditions
will show all of the ignore conditions of the specified dependency@dependabot ignore <dependency name> major version
will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)@dependabot ignore <dependency name> minor version
will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)@dependabot ignore <dependency name>
will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)@dependabot unignore <dependency name>
will remove all of the ignore conditions of the specified dependency@dependabot unignore <dependency name> <ignore condition>
will remove the ignore condition of the specified dependency and ignore conditions