Openapi.RouteValidator (Openapi v0.1.0)

Copy Markdown View Source

Summary

Functions

Validates a list of openapi route.

Functions

validate(routes, server, global_handler)

Validates a list of openapi route.

This function performs compile-time validation of a list of openapi route

Validation steps

  1. Handler validation

    • If a global_handler is provided, it is validated to ensure it is a valid module.
    • Each route is checked to ensure its handler (or fallback global handler) is a valid module when required.
  2. Operation ID validation

    • Ensures every route has a valid operationId.
    • Verifies that the resolved handler module exports a function matching the normalized operation id with arity 2 (operation_id(conn, params)).