ij.importers.openapi

Import diagrams from OpenAPI specifications.

ij.importers.openapi.from_openapi(spec: str | Dict, title: str | None = None) DiagramIR[source]

Import diagram from OpenAPI specification.

Creates a diagram showing API endpoints and their relationships.

Parameters:
  • spec – Path to OpenAPI file or dict specification

  • title – Optional diagram title

Returns:

DiagramIR representing API structure

Example

>>> diagram = from_openapi('openapi.yaml')
>>> diagram = from_openapi({'openapi': '3.0.0', ...})

Note

Requires pyyaml for YAML files: pip install pyyaml

ij.importers.openapi.from_openapi_to_sequence(spec: str | Dict, flow: str = 'default') DiagramIR[source]

Create sequence diagram from OpenAPI spec showing request flow.

Parameters:
  • spec – Path to OpenAPI file or dict

  • flow – Flow to diagram (e.g., ‘auth’, ‘crud’)

Returns:

DiagramIR as sequence diagram

Example

>>> diagram = from_openapi_to_sequence('api.yaml', flow='auth')