Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fulpm committed Oct 11, 2024
1 parent ff5e185 commit f9a0bf2
Showing 1 changed file with 1 addition and 37 deletions.
38 changes: 1 addition & 37 deletions howso/client/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class EngineApi(TypedDict):
labels: Mapping[str, LabelDefinition]
"""Engine labels."""

schemas: Mapping[str, Schema | AnyOf]
schemas: Mapping[str, Schema | Ref | AnyOf]
"""Mapping of shared schemas."""

description: str
Expand Down Expand Up @@ -131,39 +131,3 @@ def get_api(engine_path: t.Optional[Path] = None) -> EngineApi:
finally:
amlg.destroy_entity(entity_id)
del amlg


def get_api_label(label: str) -> LabelDefinition | None:
"""
Get the API definition for a given label.
Parameters
----------
label : str
The label to retrieve.
Returns
-------
LabelDefinition or None
The definition of the label, or None if the label is not defined.
"""
api = get_api()
return api["labels"].get(label)


def get_api_schema(name: str) -> Schema | Ref | None:
"""
Get a schema definition by name.
Parameters
----------
name : str
The name of the schema to retrieve.
Returns
-------
Schema or Ref or None
The schema definition, or None if not found.
"""
api = get_api()
return api["schemas"].get(name)

0 comments on commit f9a0bf2

Please sign in to comment.