1010 request_schema ,
1111 response_schema ,
1212)
13-
13+ from typing import cast
1414from marshmallow import fields , validate , validates_schema
1515
1616from ....admin .request_context import AdminRequestContext
@@ -115,7 +115,7 @@ class CreateInvitationRequestSchema(OpenAPISchema):
115115 mediation_id = fields .Str (
116116 required = False ,
117117 description = "Identifier for active mediation record to be used" ,
118- ** MEDIATION_ID_SCHEMA
118+ ** MEDIATION_ID_SCHEMA ,
119119 )
120120
121121
@@ -247,7 +247,7 @@ class ReceiveInvitationQueryStringSchema(OpenAPISchema):
247247 mediation_id = fields .Str (
248248 required = False ,
249249 description = "Identifier for active mediation record to be used" ,
250- ** MEDIATION_ID_SCHEMA
250+ ** MEDIATION_ID_SCHEMA ,
251251 )
252252
253253
@@ -261,7 +261,7 @@ class AcceptInvitationQueryStringSchema(OpenAPISchema):
261261 mediation_id = fields .Str (
262262 required = False ,
263263 description = "Identifier for active mediation record to be used" ,
264- ** MEDIATION_ID_SCHEMA
264+ ** MEDIATION_ID_SCHEMA ,
265265 )
266266
267267
@@ -536,11 +536,16 @@ async def connections_create_invitation(request: web.BaseRequest):
536536 metadata = metadata ,
537537 mediation_id = mediation_id ,
538538 )
539-
539+ invitation_url = invitation .to_url (base_url )
540+ base_endpoint = service_endpoint or cast (
541+ str , profile .settings .get ("default_endpoint" )
542+ )
540543 result = {
541544 "connection_id" : connection and connection .connection_id ,
542545 "invitation" : invitation .serialize (),
543- "invitation_url" : invitation .to_url (base_url ),
546+ "invitation_url" : f"{ base_endpoint } { invitation_url } "
547+ if invitation_url .startswith ("?" )
548+ else invitation_url ,
544549 }
545550 except (ConnectionManagerError , StorageError , BaseModelError ) as err :
546551 raise web .HTTPBadRequest (reason = err .roll_up ) from err
0 commit comments