DuchessFrance / HandsOnCassandraChat

A hand's on about Cassandra 2.0
3 stars 2 forks source link

Define REST API #3

Open doanduyhai opened 9 years ago

doanduyhai commented 9 years ago

TBD

doanduyhai commented 9 years ago
mimiiix commented 9 years ago

Just a question regarding the api that lists the rooms belonging to a specific user with a given login. Why are we browsing the rooms api to do so? We could do something like :

List users room by pages: GET /users/rooms?fromRoomName=games&fetchSize=10

fromRoomName: start listing from this room name, OPTIONAL
fetchSize: limit the search to fetchSize, OPTIONAL

What do you think ? @doanduyhai maybe your modelisation is constraining the api ?

mimiiix commented 9 years ago

Slight remark but completely personal. I dislike camel case in json payloads, i find it less readable. We could put a dash separator ?

mimiiix commented 9 years ago

Here i think you wanted to put GET instead of PUT to list users :)

List users: GET /users?fromUserLogin=jdoe&fetchSize=10

fromUserLogin: start listing from this login, OPTIONAL
fetchSize: limit the search to fetchSize, OPTIONAL
doanduyhai commented 9 years ago

List users: GET /users?fromUserLogin=jdoe&fetchSize=10 --> Fixed, thanks

doanduyhai commented 9 years ago

"Just a question regarding the api that lists the rooms belonging to a specific user with a given login. Why are we browsing the rooms api to do so?" --> You're right, we could move this feature into the /users API.

doanduyhai commented 9 years ago

"I dislike camel case in json payloads, i find it less readable. We could put a dash separator ?" --> Easy, I'll add @JsonProperty to the fields

mimiiix commented 9 years ago

@doanduyhai :+1: