|
18 | 18 | from ....admin.request_context import AdminRequestContext |
19 | 19 | from ....anoncreds.holder import AnonCredsHolder, AnonCredsHolderError |
20 | 20 | from ....anoncreds.models.presentation_request import AnoncredsPresentationRequestSchema |
| 21 | +from ....anoncreds.models.proof import AnoncredsPresSpecSchema |
21 | 22 | from ....connections.models.conn_record import ConnRecord |
22 | 23 | from ....indy.holder import IndyHolder, IndyHolderError |
23 | 24 | from ....indy.models.cred_precis import IndyCredPrecisSchema |
@@ -233,7 +234,8 @@ def validate_fields(self, data, **kwargs): |
233 | 234 | """ |
234 | 235 | if not any(f.api in data for f in V20PresFormat.Format): |
235 | 236 | raise ValidationError( |
236 | | - "V20PresRequestByFormatSchema requires indy, dif, or both" |
| 237 | + "V20PresRequestByFormatSchema requires at least one of: " |
| 238 | + "anoncreds, indy, dif" |
237 | 239 | ) |
238 | 240 |
|
239 | 241 |
|
@@ -310,7 +312,7 @@ class V20PresSpecByFormatRequestSchema(AdminAPIMessageTracingSchema): |
310 | 312 | """Presentation specification schema by format, for send-presentation request.""" |
311 | 313 |
|
312 | 314 | anoncreds = fields.Nested( |
313 | | - IndyPresSpecSchema, |
| 315 | + AnoncredsPresSpecSchema, |
314 | 316 | required=False, |
315 | 317 | metadata={"description": "Presentation specification for anoncreds"}, |
316 | 318 | ) |
@@ -1236,7 +1238,7 @@ async def present_proof_send_presentation(request: web.BaseRequest): |
1236 | 1238 | raise web.HTTPBadRequest( |
1237 | 1239 | reason=( |
1238 | 1240 | "No presentation format specification provided, " |
1239 | | - "either dif or indy must be included. " |
| 1241 | + "either dif, anoncreds or indy must be included. " |
1240 | 1242 | "In case of DIF, if no additional specification " |
1241 | 1243 | 'needs to be provided then include "dif": {}' |
1242 | 1244 | ) |
|
0 commit comments