OpenAPI¶
openapi ¶
OpenAPI specification handling for T3 API endpoints.
CollectionEndpoint ¶
Bases: TypedDict
Type definition for a collection endpoint.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
The URL path of the endpoint (e.g. |
method |
str
|
The HTTP method in uppercase (e.g. |
name |
str
|
A user-friendly display name derived from the summary or path. |
category |
str
|
The grouping category derived from tags or path segments. |
description |
str
|
A human-readable description of what the endpoint returns. |
fetch_openapi_spec ¶
Fetch the OpenAPI specification from the live T3 API.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The parsed OpenAPI specification as a dictionary. |
Raises:
| Type | Description |
|---|---|
SystemExit
|
If the API cannot be reached or returns invalid data. |
Source code in t3api_utils/openapi/spec_fetcher.py
get_collection_endpoints ¶
Fetch and parse collection endpoints from the live API.
Convenience function that fetches the OpenAPI spec and extracts all paginated collection endpoints in a single call.
Returns:
| Type | Description |
|---|---|
List[CollectionEndpoint]
|
A list of |
List[CollectionEndpoint]
|
collection. |
Raises:
| Type | Description |
|---|---|
SystemExit
|
If the API spec cannot be fetched or contains no collection endpoints. |
Source code in t3api_utils/openapi/spec_fetcher.py
pick_collection ¶
Interactive picker for selecting a collection endpoint.
Returns:
| Type | Description |
|---|---|
CollectionEndpoint
|
The selected collection endpoint. |
Raises:
| Type | Description |
|---|---|
SystemExit
|
If user cancels or no endpoints are available. |