Version: v1.2.3 | Status: Stable | Last Updated: March 2026
The api module provides foundations for defining, documenting, and standardizing APIs within Codomyrmex. It supports REST and GraphQL paradigms and includes automated documentation generation.
APIDocumentationGenerator: Analyzes code to produce API docs.generate_api_docs: Helper function to trigger doc generation.generate_openapi_spec_from_docs: Converts internal docs to OpenAPI 3.0.
RESTAPI: Framework for defining RESTful interfaces.GraphQLAPI: Framework for defining GraphQL schemas.APIVersionManager: Handles API versioning strategies.
APIEndpoint: Metadata for a single API route.APISchema: Definition of data models.OpenAPISpecification: Wrapper for OpenAPI structure.
from codomyrmex.api import RESTAPI, create_router
app = RESTAPI(title="My Service")
router = create_router()
@router.get("/items")
def get_items():
return [{"id": 1}]
app.include_router(router)