apiblueprint - Custom action names in API Blueprint -
i'm trying write api , struggling figure out nice way of adding custom actions resource. example, in user resource want have actions enabled , disable, within usual design grouping can't add together these under group:
## user [/users/{id}] ### update user [patch] ... ### delete user [delete] ... ### disable user [patch] .... here, disable user , update user both point same url isn't want. want these produce urls /users/{id} , /users/{id}/disable respectively.
looking through other api source, others have done without using named resources, give:
## /users/{id} ### update user [patch] ... ### delete user [delete] ... ## /users/{id}/disable ### disable user [patch] ... whilst can utilize approach, i'd prefer utilize first approach it's cleaner when gets rendered blueprinting tools.
is there way of having custom actions using first approach, or else have cleaner way of implementing same kind of thing
in example, because there 2 different urls, end 2 separate resources. 1 resource user resource, while other disable user resource. organize these in api blueprint, can grouping these resources resource group.
# grouping user resources ## user [/users/{id}] ### update user [patch] ... ### delete user [delete] ... ## disable user [/users/{id}/disable] ### disable user [patch] ... this allows have separate actions on separate urls while keeping them tied in documentation.
apiblueprint
No comments:
Post a Comment