Javarevisited

A humble place to learn Java and Programming better.

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?

5 min readFeb 24, 2025

--

All of my REST API BEST PRACTISES articles are added in this library.

Photo by Sincerely Media on Unsplash

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.

--

--

Javarevisited
Javarevisited

Published in Javarevisited

A humble place to learn Java and Programming better.

Sivaram Rasathurai
Sivaram Rasathurai

Written by Sivaram Rasathurai

ATL @Sysco | Architect of Oh Taxi App | 3.6M+ Impressions & 6K+ SO Reps with 100+ java and 100+ python Tips : https://buymeacoffee.com/rcvaram

Responses (2)