The Three Tenets of API Design (1/3): Be Boring

T1: Be Boring

Consistency

{
"error": "error_type",
"error_message": "A human-readable description of the error",
"meta": {
"additional": "info"
}
}
class PostsController < ApplicationController
def create
post = Post.new
if post.save
render status: :created, json: post
else
render status: :unprocessable_entity, json: post.errors
end
end
end

Documentation

Technology leader and strategic advisor. I work at the intersection of people, software and words.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store