DEV Community

Cover image for What is the most important rule when designing an API?
decker
decker

Posted on • Updated on

What is the most important rule when designing an API?

When designing an API for your Application Frontend, what is your rule of thumb?

Top comments (8)

Collapse
 
ecyrbe profile image
ecyrbe

These are some rules i apply that may not suit everyone:

  • share Ideas with your team
  • make sure you design user faced API
  • make distinct APIs for product admins and standard users
  • always design with security in mind
  • design it with separation concern
  • list your expected errors
  • do not handle unwanted use cases because 'maybe it could be used'
  • do not add complexity
  • make it reviewed by another team
Collapse
 
kolja profile image
Kolja

Make it save for ways you dont think about in the first way.

Collapse
 
dougatgrafbase profile image
Doug Schwartz

Don't make me think.

Collapse
 
syeo66 profile image
Red Ochsenbein (he/him) • Edited

Keep it consistent. (Used patterns and naming)
Don't make the frontend do the data processing.

Collapse
 
mt3o_23 profile image
Teodor Kulej

Do one task, and do it right, don't overthink it.

If you want a rule that's less verbal and more technical, refer to SOLID principles.

Collapse
 
decker67 profile image
decker

Make it functional not technical, because the underlying technic can change more often than the desired function.

Collapse
 
josunlp profile image
Jonas Pfalzgraf

Use the Open API standard with Swagger to simplify documentation and allow developers and users to work with it in a meaningful way.

Collapse
 
cecon profile image
Gabriel Cecon Carlsen

Modularity. Each part has its own resposaility (easy to maintain)