Member-only story
REST API BEST PRACTISES #3
Is Using Sub-Resources for Actions in REST API a Trap?
How do you structure actions in a RESTful way?
All of my REST API BEST PRACTISES articles are added in this library.
Some developers argue by using sub-resources ( POST /orders/{orderId}/cancel
), claiming it keeps things clean and intuitive.
Others warn that this approach can rapidly spiral into a rigid, unmaintainable mess.
So π€,
are sub-resources the key to a well-structured API π?
β β β β β β β β β-ORβ β β β β β β β β β
are they secretly sabotaging your architectureπ³?
Letβs Breakdown below π
Your claps π help the article reach more developers π on Medium, and your comments make me to keep writingβοΈ. If you blocked by medium paywall, Guess what? π Surprice is in this link.
What Sub-Resources for Actions?
At its core, RESTful APIs focus on resources β nouns like orders
, users
, and products
.