kuzzleio / sdk-jvm

Official Kotlin SDK for Kuzzle
https://kuzzle.io
1 stars 0 forks source link

SDK should ensure that the body is a HashMap #62

Closed Aschen closed 2 years ago

Aschen commented 2 years ago

Description

The body of a request can only be a HashMap so the SDK should ensure that the query argument of the Query() method contains a valid body

Shiranuit commented 2 years ago

That's not the case, in fact it is only required to give the Query method an HashMap<String, Object>

In this case the body property can be any object that we can serialize, ie: Number, String, Boolean, Array, HashMap

Map<String, Object> query = new HashMap<>();
query.put("controller", "document");
query.put("action", "create");
query.put("_id", "myItem4");
query.put("body", body)

I suspect there is another bug when users are putting a String in the body, I will take a look at it