apigraph package¶
Submodules¶
apigraph.graph module¶
-
class
apigraph.graph.APIGraph(start_uri)[source]¶ Bases:
object-
chain_for_node(node_key, chain_id, traverse_anonymous=True)[source]¶ Get a subgraph view containing ancestors of node_key which are related via edges having this chain_id.
NOTE: Includes the node identified by node_key itself.
If traverse_anonymous=True then will return ancestors with no chain_id in additional to the requested chain_id (this is because chainId is an extension to OpenAPI and you may reach documents which do not use it, also it allows to avoid creating redundant links for multiple chains, null chain can be used as a default link).
- Raises
- Return type
MultiDiGraph
-
docs: Dict[str, openapi_orm.models.OpenAPI3Document]¶
-
get_operation(node_key)[source]¶ Get operation element specified by node_key from relevant api doc.
- Return type
Operation
-
graph: networkx.classes.multidigraph.MultiDiGraph¶
-
apigraph.loader module¶
apigraph.types module¶
-
class
apigraph.types.EdgeKey(chain_id, response_id)[source]¶ Bases:
tuple-
chain_id: Optional[str]¶ Alias for field number 0
-
response_id: str¶ Alias for field number 1
-
-
class
apigraph.types.HttpMethod(value)[source]¶ Bases:
str,enum.EnumAn enumeration.
-
DELETE= 'delete'¶
-
GET= 'get'¶
-
HEAD= 'head'¶
-
OPTIONS= 'options'¶
-
PATCH= 'patch'¶
-
POST= 'post'¶
-
PUT= 'put'¶
-
TRACE= 'trace'¶
-
-
class
apigraph.types.LinkDetail(link_type: apigraph.types.LinkType, name: str, description: str, parameters: Dict[str, str], requestBody: Union[apigraph.types.NotSet, str, Any], requestBodyParameters: Dict[str, str])[source]¶ Bases:
tupleCollates and normalises the relevant Link/Backlink details
-
description: str¶ Alias for field number 2
-
link_type: apigraph.types.LinkType¶ Alias for field number 0
-
name: str¶ Alias for field number 1
-
parameters: Dict[str, str]¶ Alias for field number 3
-
requestBody: Union[apigraph.types.NotSet, str, Any]¶ Alias for field number 4
-
requestBodyParameters: Dict[str, str]¶ Alias for field number 5
-
-
class
apigraph.types.LinkType(value)[source]¶ Bases:
enum.EnumAn enumeration.
-
BACKLINK= 2¶
-
LINK= 1¶
-
-
class
apigraph.types.NodeKey(doc_uri, path, method)[source]¶ Bases:
tuple-
doc_uri: str¶ Alias for field number 0
-
method: apigraph.types.HttpMethod¶ Alias for field number 2
-
path: str¶ Alias for field number 1
-
-
class
apigraph.types.OperationDetail(path: str, method: apigraph.types.HttpMethod, summary: str, description: str, parameters: Dict[apigraph.types.ParamKey, openapi_orm.models.Parameter], requestBody: Optional[openapi_orm.models.RequestBody], security_schemes: Set[FrozenSet[Union[openapi_orm.models.APIKeySecurityScheme, openapi_orm.models.HTTPSecurityScheme, openapi_orm.models.OAuth2SecurityScheme, openapi_orm.models.OpenIDConnectSecurityScheme]]])[source]¶ Bases:
tupleCollates and normalises the relevant Operation details
-
description: str¶ Alias for field number 3
-
method: apigraph.types.HttpMethod¶ Alias for field number 1
-
parameters: Dict[apigraph.types.ParamKey, openapi_orm.models.Parameter]¶ Alias for field number 4
-
path: str¶ Alias for field number 0
-
requestBody: Optional[openapi_orm.models.RequestBody]¶ Alias for field number 5
-
security_schemes: Set[FrozenSet[Union[openapi_orm.models.APIKeySecurityScheme, openapi_orm.models.HTTPSecurityScheme, openapi_orm.models.OAuth2SecurityScheme, openapi_orm.models.OpenIDConnectSecurityScheme]]]¶ Alias for field number 6
-
summary: str¶ Alias for field number 2
-