Convert Figma logo to code with AI

zalando logorestful-api-guidelines

A model set of guidelines for RESTful APIs and Events, created by Zalando

2,608
384
2,608
15

Top Related Projects

Microsoft REST API Guidelines

The OpenAPI Specification Repository

Style guides for Google-originated open-source projects

Quick Overview

The zalando/restful-api-guidelines repository is a comprehensive set of guidelines for RESTful API design and development. It provides best practices, standards, and recommendations for creating consistent, scalable, and maintainable APIs, specifically tailored for Zalando's engineering teams but widely applicable to other organizations.

Pros

  • Offers a detailed and well-structured approach to API design
  • Provides clear examples and explanations for each guideline
  • Regularly updated and maintained by a large community of contributors
  • Covers a wide range of API-related topics, from naming conventions to security

Cons

  • May be overwhelming for beginners due to the extensive number of guidelines
  • Some guidelines may be specific to Zalando's ecosystem and not universally applicable
  • Requires significant effort to implement all guidelines in existing APIs
  • May conflict with other established API design standards in some areas

Note: As this is not a code library, the code examples and getting started instructions sections have been omitted.

Competitor Comparisons

Microsoft REST API Guidelines

Pros of api-guidelines

  • More comprehensive coverage of API design topics, including versioning, error handling, and security
  • Includes detailed examples and code snippets for better understanding
  • Provides guidance on Microsoft-specific technologies and practices

Cons of api-guidelines

  • Less focus on RESTful principles compared to restful-api-guidelines
  • May be overly complex for smaller projects or teams new to API design
  • Some guidelines are specific to Microsoft ecosystems, potentially limiting applicability

Code Comparison

restful-api-guidelines:

paths:
  /items:
    get:
      summary: List items
      responses:
        '200':
          description: Successful response
          content:
            application/json:    
              schema:
                $ref: '#/components/schemas/ItemList'

api-guidelines:

{
  "api": {
    "name": "Example API",
    "version": "1.0.0",
    "endpoints": [
      {
        "name": "GetItems",
        "method": "GET",
        "path": "/items",
        "responses": [
          {
            "code": 200,
            "description": "Successful response",
            "schema": {
              "$ref": "#/definitions/ItemList"
            }
          }
        ]
      }
    ]
  }
}

Both repositories provide valuable guidance for API design, with restful-api-guidelines focusing more on RESTful principles and api-guidelines offering a broader scope of API design considerations. The choice between them depends on project requirements and team preferences.

The OpenAPI Specification Repository

Pros of OpenAPI-Specification

  • Widely adopted industry standard for API documentation
  • Extensive tooling ecosystem for code generation, testing, and documentation
  • Supports multiple API styles beyond REST (e.g., gRPC, WebSockets)

Cons of OpenAPI-Specification

  • Can be more complex and verbose for simple APIs
  • Requires additional effort to maintain and keep in sync with implementation
  • Less opinionated about API design best practices

Code Comparison

OpenAPI-Specification:

openapi: 3.0.0
info:
  title: Sample API
  version: 1.0.0
paths:
  /users:
    get:
      summary: List users

restful-api-guidelines:

# No specific code format; focuses on guidelines and best practices
# Example guideline:
# MUST use lowercase separate words with hyphens for path segments
/users
/user-groups

Summary

OpenAPI-Specification provides a standardized way to describe APIs, with broad industry support and tooling. restful-api-guidelines offers opinionated best practices for RESTful API design. While OpenAPI-Specification is more flexible and widely adopted, restful-api-guidelines may be more suitable for teams seeking consistent API design principles within their organization.

Pros of api-standards

  • Concise and straightforward guidelines, making it easier for beginners to understand
  • Focuses on U.S. government-specific requirements, which can be beneficial for related projects
  • Includes clear examples of good and bad practices for each guideline

Cons of api-standards

  • Less comprehensive than restful-api-guidelines, covering fewer topics
  • Not actively maintained, with the last update being several years ago
  • Lacks detailed explanations for some guidelines, which may leave room for interpretation

Code Comparison

api-standards:

{
  "id": "123",
  "name": "John Doe",
  "email": "john@example.com"
}

restful-api-guidelines:

{
  "id": "123",
  "name": "John Doe",
  "email": "john@example.com",
  "created_at": "2023-04-15T12:00:00Z",
  "updated_at": "2023-04-15T12:00:00Z"
}

The restful-api-guidelines example includes additional fields for tracking creation and update timestamps, demonstrating a more comprehensive approach to API design.

Style guides for Google-originated open-source projects

Pros of styleguide

  • Covers a wide range of programming languages (C++, Java, Python, R, Shell, etc.)
  • Provides detailed guidelines for code formatting, naming conventions, and best practices
  • Regularly updated and maintained by Google engineers

Cons of styleguide

  • Focuses primarily on code style rather than API design principles
  • May be too opinionated for some developers or organizations
  • Lacks specific guidance for RESTful API design and implementation

Code Comparison

styleguide (Python):

def SampleFunction(parameter_list):
    """Describe what the function does.

    Args:
      param1: Description of param1.
      param2: Description of param2.

    Returns:
      Description of return value.
    """
    # Function body

restful-api-guidelines (OpenAPI):

paths:
  /resource:
    get:
      summary: List resources
      description: Returns a list of resources
      responses:
        '200':
          description: Successful response
          content:
            application/json:    
              schema:
                $ref: '#/components/schemas/ResourceList'

The styleguide repository provides comprehensive coding style guidelines for multiple programming languages, making it valuable for general software development. However, it lacks specific guidance for RESTful API design. On the other hand, the restful-api-guidelines repository focuses exclusively on RESTful API design principles, offering more targeted advice for API developers but with a narrower scope overall.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

= Developing Restful APIs: A Comprehensive Set of Guidelines by Zalando

https://github.com/zalando/restful-api-guidelines/actions/[image:https://github.com/zalando/restful-api-guidelines/actions/workflows/build.yml/badge.svg[Build status]] Latest published version: http://zalando.github.io/restful-api-guidelines/[*HTML*],

== Purpose

Great RESTful APIs look like they were designed by a single team. This promotes API adoption, reduces friction, and enables clients to use them properly. To build APIs that meet this standard, and to answer many common questions encountered along the way of RESTful API development, the Zalando Tech team has created this comprehensive set of guidelines. We have shared it with you to inspire additional discussion and refinement within and among your teams, and contribute our learnings and suggestions to the tech community at large.

== Usage

Feel free to use these guidelines as a guidance for your own development. Note that we encourage our own teams to use them in order to challenge their APIs. As such, you should consider this to be a living, evolving document. We will revise and update based on our learnings and experiences.

See link:BUILD.adoc[BUILD documentation] for technical details.

== License

We have published these guidelines under the CC-BY (Creative commons Attribution 4.0) license. Please see link:LICENSE[LICENSE file].