Skip to content
This repository was archived by the owner on Feb 22, 2019. It is now read-only.

Conversation

@scottinet
Copy link
Contributor

@scottinet scottinet commented Jun 2, 2017

Description

It makes little sense to force Android SDK clients to use JSONArray to pass a collection of objects, or to receive one as a return value/callback resolution value.
Moreover, using JSONArray is inconsistent with the documentation and the way other SDKs are implemented.

A PR is currently under preparation on the Android SDK to replace all JSONArray arguments and returned values. This PR updates the documentation accordingly.

Other changes

  • The hscan API documentation page was incorrectly labelled hmset and thus it wasn't listed in the menu
  • Update the hscan, scan, sscan and zscan return format for SDKs. This change has also been applied to all SDK implementations (Android, PHP and Javascript)
  • Fix Profile.getPolicies and Profile.setPolicies Java code examples
  • [JS SDK] Add the Promise suffix to all promisified *Credentials method names
  • Fix the Security.getUserRights callback example to allow it to be displayed for all language tabs
  • Add response examples to all *Credentials methods in the SDK Reference
  • Fix the Security.hasCredentials and Security.validateCredentials descriptions (they were copy-pasted from Security.updateCredentials)
  • Make the routes Security.createProfile and Security.updateProfile take an array of policies, instead of an object with 1 policies key containing the list of policies
  • Fix the Security.searchProfiles documentation inconsistencies

.getMyRights(function(error, result) {
// result is a JSON object
.getMyRights(function(error, rights) {
// result is an array of JSON objects
Copy link
Contributor

Choose a reason for hiding this comment

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

result rights is an array of JSON objects
(in js, the JSON is already parsed and we actually get a POJO object here)

// result is a JSON object
.then((rights) => {
// result is an array of JSON objects
});
Copy link
Contributor

Choose a reason for hiding this comment

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

same a above and other references below.

## Callback response

Resolves to a `JSON` object.
Resolves to an array of `JSON` objects.
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above. Only true for java.
Resovles to an array of JSON objects rights.

@scottinet
Copy link
Contributor Author

@benoitvidis > done

I also changed Kuzzle.getStatistics() and Security.createProfile() according to @ballinette's remarks (see kuzzleio/sdk-android#133 (review)), so you might want to review these changes too.

@scottinet
Copy link
Contributor Author

WIP: checking all security routes for inconsistencies

@scottinet scottinet added the wip label Jun 6, 2017
@scottinet scottinet removed the wip label Jun 6, 2017
@scottinet
Copy link
Contributor Author

Done.

```json
[
{
controller: 'my-controller', action: 'my-action', index: '*', collection: '*',
Copy link
Contributor

Choose a reason for hiding this comment

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

replace:
controller: 'my-controller', action: 'my-action', index: '*', collection: '*',
by:
"controller": "my-controller", "action": "my-action", "index": "*", "collection": "*",

"field2",
"field2 value"
]
]
Copy link
Contributor

Choose a reason for hiding this comment

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

replace last ] by }

@scottinet
Copy link
Contributor Author

@stafyniaksacha > done

@benoitvidis benoitvidis merged commit 278b4e0 into rc.x Jun 15, 2017
@benoitvidis benoitvidis deleted the fix-android-prototypes branch June 15, 2017 09:58
@scottinet scottinet mentioned this pull request Jun 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants