class
and method
names thanks to respecting OpenAPI vendor extensions. This allows making the resulting client code much more semantic, especially in the case when Tags that are used by default are not descriptive enough or simply not suited for the naming purpose.<dependency>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>openapi-core</artifactId>
</dependency>
Read
requests in OData batchread
request in Batch with OData v4 API then things are going to look familiar to you. We're working towards unifying Batch API between two OData versions. We started with read
requests as they were not supported in OData v2. Check the code snippet below and our documentation for more details.BusinessPartnerService service = new DefaultBusinessPartnerService();
BusinessPartnerFluentHelper readOperationAll = service.getAllBusinessPartner().top(10);
BusinessPartnerByKeyFluentHelper readOperationByKey = service.getBusinessPartnerByKey("bupa9000");
BatchResponse response = service.batch()
.addReadOperations(readOperationAll)
.addReadOperations(readOperationByKey)
.executeRequest(destination);
List<BusinessPartner> entities = response.getReadResult(readOperationAll);
BusinessPartner entity = response.getReadResult(readOperationByKey);
CSRF
tokens for your requests implicitly. That might be sub-optimal in the development environment or when you're operating in a fully trusted environment. For these and other relevant use cases you can now suppress fetching and sending of the CSRF
token with withoutCsrfToken()
.DefaultHttpDestination
. The .proxyAuthorization("value")
will send a value
within the Proxy-Authorization
header unless that header is already set.final Destination destination = DestinationAccessor.getDestination(destinationName);
try {
RemoteFunctionCache.clearCache(destination);
}
catch( final RemoteFunctionException e ) {
//deal with exception
}
final Destination destination = DestinationAccessor.getDestination(destinationName);
try {
RemoteFunctionCache.clearCache(destination, "BAPI_GET_COSTCENTER");
}
catch( final RemoteFunctionException e ) {
//deal with exception
}
pom.xml
file. Bump the version of com.sap.cloud.sdk
dependency to 3.41.0
similar to the XML code snippet below and you're done! Mind, because Maven Central relying on CDN it takes a bit of time for the new maven module to be distributed.<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.sap.cloud.sdk</groupId>
<artifactId>sdk-bom</artifactId>
<version>3.41.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
<!-- possibly further managed dependencies ... -->
</dependencyManagement>
mvn clean install
from the command line in the root directory of your project.import {
SingleFixedRateConversionResult,
buildConversionParameterForFixedRate
} from '@sap-cloud-sdk/currency-conversion-models';
import { CurrencyConverter } from '@sap-cloud-sdk/currency-conversion-core';
// Initialize the Currency Conversion Library.
const currConverter = new CurrencyConverter();
try {
const result: SingleFixedRateConversionResult = currConverter.convertCurrencyWithFixedRate(
buildConversionParameterForFixedRate('INR', 'USD', '10.00', '70.23')
);
} catch (error) {
// Exception handling here
}
classes
and methods
. To help with situations when tags are not the best source of names we decided to use OpenAPI vendor extensions x-sap-cloud-sdk-api-name
and x-sap-cloud-sdk-operation-name
to help you make your generated client have semantic naming.executeRaw()
method to get access to a raw HTTP responseexecute()
method. This saves a lot of time because you don't have to build the test request yourself and still benefit from accessing the full request context. Check the code snippet below, and our documentation for more details.const httpResponse: HttpResponse = MyEntity.requestBuilder()
.getAll()
.executeRaw(destination);
const status = httpResponse.status;
const responseHeaders = httpResponse.headers;
const responseBody = httpResponse.data;
const request = httpResponse.request;
npm update
in the root folder of your module. Note that this will also update other modules unless you explicitly specify which packages to update. If you want to check beforehand what will change, use npm outdated
.You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
26 | |
24 | |
21 | |
13 | |
11 | |
9 | |
9 | |
8 | |
8 | |
8 |