Documentation

OpenAPI

Generate API specs and expose docs endpoints.

Overview

OpenAPI metadata keeps client and server contracts synchronized.

Example

Go

spec := openapi.NewGenerator("Elgon API", elgon.Version)
spec.Register(app, "/openapi.json", "/swagger")

Best Practices

  • Define operation metadata near handlers.
  • Version OpenAPI docs with your release process.

Common Pitfalls

  • Letting API behavior drift from spec examples.
  • Publishing internal endpoints in public docs.