cancel
Showing results for 
Search instead for 
Did you mean: 

SAP BTP CLI sapcpsdk-proxygenerator generates deprecated DataService

jakobvinther
Discoverer
0 Kudos
478

I'm currently working on a project where we generate proxy classes using the command line tool sapcpsdk-proxygenerator provided together with the latest Mac application "SAP BTP SDK Assistant for iOS" version 8.0.0.

However, when the proxy classes is generated, we get a warning in Xcode that the generated DataService is deprecated, "'DataService' is deprecated: renamed to 'LegacyDataService'".

There doesn't seem to be a way to have the command line tool generate a non-deprecated type, or maybe I'm missing something somewhere.

The documentation on DataService states

/// Deprecated. For full backwards compatibility, use `LegacyDataService`.
/// However it is recommended to use a service class with Swift.Result-style async functions.
/// This will require application code changes, but makes your code easier to integrate with the Swift Combine framework.
/// Please consider using one of the service class variants that supports Swift.Result-style async functions: `BaseDataService`, `OfflineDataService` or `OnlineDataService`.

Preferably, I'd like to migrate to one of the suggested types OnlineDataService, but I'm unsure as to how to do that with the Command line tool.

Accepted Solutions (1)

Accepted Solutions (1)

evanireland
Product and Topic Expert
Product and Topic Expert
0 Kudos

If you want to use Swift.Result-style async, try adding the -online option to the sapcpsdk-proxygenerator tool command line.

If you just want to get rid of the "deprecated" warning, add the "-legacy" option which will still result in the old async style, but without producing a deprecation warning.

jakobvinther
Discoverer
0 Kudos

Thanks a lot evanireland, that solved my issue

Would be nice if the options you mention could be part of "sapcpsdk-proxygenerator --help".

As well, after looking further, I've found that the CLI version that I'm using is "20.3.0-6b3997-20200324", and the ODate framework is "22.5.2", though I was sure I had installed the newest CLI version. But I'm missing a --version option, or have the version in the help description, since its difficult to figure out what version is actually used.

AlexGiguere
Contributor
0 Kudos

the online CLI argument as it stays only works for an OData online project

all our apps used the offline SDK, so it does not work for us, we need to use the old completion handler style

how can we used the new style with an offline project ?

thanks

alex

Answers (0)