This article provides a set of best practices for designing REST APIs, including using plural nouns for collections, avoiding unnecessary path segments, not adding extensions to URLs, not returning arrays as top level responses, using strings for all identifiers, prefixing identifiers, not using 404 to indicate 'not found',

12m read timeFrom github.com
Post cover image
Table of contents
Rule #1: DO use plural nouns for collectionsRule #2: DON'T add unnecessary path segmentsRule #3: DON'T add .json or other extensions to the urlRule #4: DON'T return arrays as top level responsesRule #5: DON'T return map structuresRule #6: DO use strings for all identifiersRule #7: DO prefix your identifiersRule #8: DON'T use 404 to indicate "not found"Rule #9: BE consistentRule #10: DO use a structured error formatRule #11: DO provide idempotence mechanismsTL;DR
4 Comments

Sort: