Advanced Infrastructure Developer Guidelines

Best Practices for OpenAPI Documentation

Writing clear and comprehensive OpenAPI documentation is critical for developer adoption and API longevity. Below are best practices for versioning, model management, and endpoint documentation.


1. Model Management

Models (schemas) define the structure of request/response data. Consistency here reduces confusion.

Best Practices:


2. Endpoint Documentation

Clear endpoint docs help developers integrate quickly.

Best Practices:


Where do I add documentation?

Good question, cowboy. We use serverless.yml to manage API declarations and deployments to APIGateway. So, it made sense to add a block for endpoint documentation.

All documentation is added in the docs folder. The yaml file follows the OpenAPI standards. Read about OpenAPI spec here openAPI

Next, edit serverless open serverless.yml in be-api-test serverless Under functions, see the documentation block documentation: ${file(./docs/api/documentation.yml):endpoints.api-endpoint}

Make sure you declare the documentation block for every endpoint.


Final Tips

Well-documented APIs reduce support overhead and empower developers to build faster. 📘🚀