您认为以下API有多不稳定:
/posts:
/{post-id}:
/likes:
description: Collection of 'likes' that can be allocated to a post
get:
description: Get likes for a post
is: [traits.pageable]
post:
description: Add a like to a post
delete:
description: Unlike a post (with queryParameter identifying the user)
请注意,delete
请求将发送到集合(而不是单个实体)
我没有看到以下形式提供单一资源的重点:
/posts:
/{post-id}:
/likes/{like-id} => DELETE
使用像Mongodb这样的数据库,喜欢也可以 - 根本没有id。