diff --git a/aries_cloudagent/revocation/routes.py b/aries_cloudagent/revocation/routes.py index 83505db7d4..7b6b890d56 100644 --- a/aries_cloudagent/revocation/routes.py +++ b/aries_cloudagent/revocation/routes.py @@ -290,20 +290,17 @@ class PublishRevocationsSchema(OpenAPISchema): ) -class TxnOrPublishRevocationsResultSchema(OpenAPISchema): +class TxnOrPublishRevocationsResultSchema(PublishRevocationsSchema): """Result schema for credential definition send request.""" - sent = fields.Nested( - PublishRevocationsSchema(), - required=False, - metadata={"definition": "Content sent"}, - ) - txn = fields.Nested( - TransactionRecordSchema(), - required=False, - metadata={ - "description": "Revocation registry revocations transaction to endorse" - }, + txn = fields.List( + fields.Nested( + TransactionRecordSchema(), + required=False, + metadata={ + "description": "Revocation registry revocations transaction to endorse" + }, + ) ) @@ -661,13 +658,10 @@ async def publish_revocations(request: web.BaseRequest): raise web.HTTPBadRequest(reason=err.roll_up) from err if create_transaction_for_endorser: - return web.json_response( - ( - await _process_publish_response_for_endorsement( - profile, rev_reg_responses, outbound_handler, endorser_conn_id - ) - ) + list_of_txns = await _process_publish_response_for_endorsement( + profile, rev_reg_responses, outbound_handler, endorser_conn_id ) + return web.json_response({"txn": list_of_txns}) return web.json_response({"rrid2crid": result}) @@ -702,7 +696,7 @@ async def _process_publish_response_for_endorsement( await outbound_handler(transaction_request, connection_id=endorser_conn_id) - txn_responses.append({"txn": transaction.serialize()}) + txn_responses.append(transaction.serialize()) return txn_responses @@ -1926,4 +1920,4 @@ def post_process_routes(app: web.Application): methods["get"]["responses"]["200"]["schema"] = { "type": "string", "format": "binary", - } \ No newline at end of file + } diff --git a/open-api/openapi.json b/open-api/openapi.json index c68e24bbd7..06928e55a6 100644 --- a/open-api/openapi.json +++ b/open-api/openapi.json @@ -13703,15 +13703,28 @@ }, "TxnOrPublishRevocationsResult" : { "properties" : { - "sent" : { - "$ref" : "#/components/schemas/PublishRevocations" + "rrid2crid" : { + "additionalProperties" : { + "items" : { + "description" : "Credential revocation identifier", + "example" : "12345", + "pattern" : "^[1-9][0-9]*$", + "type" : "string" + }, + "type" : "array" + }, + "description" : "Credential revocation ids by revocation registry id", + "type" : "object" }, "txn" : { - "allOf" : [ { - "$ref" : "#/components/schemas/TransactionRecord" - } ], - "description" : "Revocation registry revocations transaction to endorse", - "type" : "object" + "items" : { + "allOf" : [ { + "$ref" : "#/components/schemas/TransactionRecord" + } ], + "description" : "Revocation registry revocations transaction to endorse", + "type" : "object" + }, + "type" : "array" } }, "type" : "object" diff --git a/open-api/swagger.json b/open-api/swagger.json index 63fe57fb0c..94e015c136 100644 --- a/open-api/swagger.json +++ b/open-api/swagger.json @@ -12148,11 +12148,28 @@ "TxnOrPublishRevocationsResult" : { "type" : "object", "properties" : { - "sent" : { - "$ref" : "#/definitions/PublishRevocations" + "rrid2crid" : { + "type" : "object", + "description" : "Credential revocation ids by revocation registry id", + "additionalProperties" : { + "type" : "array", + "items" : { + "type" : "string", + "example" : "12345", + "description" : "Credential revocation identifier", + "pattern" : "^[1-9][0-9]*$" + } + } }, "txn" : { - "$ref" : "#/definitions/TxnOrPublishRevocationsResult_txn" + "type" : "array", + "items" : { + "type" : "object", + "description" : "Revocation registry revocations transaction to endorse", + "allOf" : [ { + "$ref" : "#/definitions/TransactionRecord" + } ] + } } } }, @@ -14803,10 +14820,6 @@ "type" : "object", "description" : "Credential definition transaction to endorse" }, - "TxnOrPublishRevocationsResult_txn" : { - "type" : "object", - "description" : "Revocation registry revocations transaction to endorse" - }, "TxnOrRegisterLedgerNymResponse_txn" : { "type" : "object", "description" : "DID transaction to endorse"