strongloop-community / loopback-sdk-ios

iOS Client SDK for the LoopBack framework.
Other
76 stars 39 forks source link

Proposal to add "accepts" and "returns" to SLRESTContract #95

Open hideya opened 8 years ago

hideya commented 8 years ago

As pointed out in https://github.com/strongloop/loopback-sdk-ios/pull/83#issuecomment-174502633, "the response ("returns" argument) is always passed as a JSON object and it's up to the API caller to extract individual arguments from the response, together with applying any type conversions as necessary."

One approach to hide that conversion process from SDK users is to add "accepts" and "returns" to SLRESTContract and perform the conversion in SLObject automatically. This should simplify the usage.