diff --git a/src/keria/app/specing.py b/src/keria/app/specing.py index fd3eeebf..8368bcd6 100644 --- a/src/keria/app/specing.py +++ b/src/keria/app/specing.py @@ -881,18 +881,6 @@ def __init__(self, app, title, version="1.0.1", openapi_version="3.1.0"): {"$ref": "#/components/schemas/ACDC_V_2"}, ] } - self.spec.components.schemas["CredentialOperationMetadata"]["properties"][ - "depends" - ] = { - "oneOf": [ - {"$ref": "#/components/schemas/ROT_V_1"}, - {"$ref": "#/components/schemas/ROT_V_2"}, - {"$ref": "#/components/schemas/DRT_V_1"}, - {"$ref": "#/components/schemas/DRT_V_2"}, - {"$ref": "#/components/schemas/IXN_V_1"}, - {"$ref": "#/components/schemas/IXN_V_2"}, - ] - } self.spec.components.schema( "CredentialOperationResponse", schema=marshmallow_dataclass.class_schema( @@ -968,13 +956,7 @@ def __init__(self, app, title, version="1.0.1", openapi_version="3.1.0"): ) self.spec.components.schemas["DelegatorOperationMetadata"]["properties"][ "depends" - ] = { - "oneOf": [ - {"$ref": "#/components/schemas/GroupOperation"}, - {"$ref": "#/components/schemas/WitnessOperation"}, - {"$ref": "#/components/schemas/DoneOperation"}, - ] - } + ] = {"$ref": "#/components/schemas/KelOperation"} self.spec.components.schema( "PendingDelegatorOperation", @@ -1002,6 +984,21 @@ def __init__(self, app, title, version="1.0.1", openapi_version="3.1.0"): ] } + self.spec.components.schemas["KelOperation"] = { + "oneOf": [ + {"$ref": "#/components/schemas/GroupOperation"}, + {"$ref": "#/components/schemas/WitnessOperation"}, + {"$ref": "#/components/schemas/DoneOperation"}, + {"$ref": "#/components/schemas/DelegationOperation"}, + ] + } + self.spec.components.schemas["RegistryOperationMetadata"]["properties"][ + "depends" + ] = {"$ref": "#/components/schemas/KelOperation"} + self.spec.components.schemas["CredentialOperationMetadata"]["properties"][ + "depends" + ] = {"$ref": "#/components/schemas/KelOperation"} + self.spec.components.schemas["Operation"] = { "oneOf": [ {"$ref": "#/components/schemas/OOBIOperation"}, diff --git a/src/keria/core/optypes.py b/src/keria/core/optypes.py index e89ac299..d9092fb5 100644 --- a/src/keria/core/optypes.py +++ b/src/keria/core/optypes.py @@ -333,6 +333,14 @@ class FailedGroupOperation(BaseGroupOperation, FailedOperation): ] +KelOperation = Union[ + "GroupOperation", + "WitnessOperation", + "DoneOperation", + "DelegationOperation", +] + + @dataclass class DelegatorOperationMetadata: pre: str @@ -345,7 +353,7 @@ class DelegatorOperationMetadata: ) }, ) - depends: Union["GroupOperation", "WitnessOperation", "DoneOperation"] = None # type: ignore + depends: KelOperation = None # type: ignore @dataclass @@ -597,9 +605,7 @@ class FailedChallengeOperation(BaseChallengeOperation, FailedOperation): @dataclass class RegistryOperationMetadata: pre: str - depends: Union[ - "GroupOperation", "WitnessOperation", "DoneOperation", "DelegationOperation" - ] + depends: KelOperation = None # type: ignore anchor: Anchor = field( default_factory=Anchor, metadata={ @@ -667,7 +673,7 @@ class FailedRegistryOperation(BaseRegistryOperation, FailedOperation): @dataclass class CredentialOperationMetadata: ced: Union[ACDC_V_1, ACDC_V_2] # type: ignore - depends: Union[ROT_V_1, ROT_V_2, DRT_V_1, DRT_V_2, IXN_V_1, IXN_V_2] = None # type: ignore + depends: KelOperation = None # type: ignore @dataclass