GoogleCloudPlatform / functions-framework-dart

FaaS (Function as a service) framework for writing portable Dart functions
https://pub.dev/packages/functions_framework
Apache License 2.0
533 stars 54 forks source link

Update functions.dart #472

Closed rosera closed 1 week ago

rosera commented 1 week ago

Issue:

Backend service unable to build due to invalid signature. Error indicates the RequestContext is not supported based on the updated api specification.

@CloudFunction()
GreetingResponse function(GreetingRequest request, RequestContext context) {
  final name = request.name ?? 'World';
  final response =
      GreetingResponse(salutation: _randomSalutation(), name: name);
  context.logger.info('greetingResponse: ${response.toJson()}');
  return response;
}

Resolution:

Resolve invalid function signature entry for backend Dart Function Frameworks example. Specifically the reference to

@CloudFunction()
GreetingResponse function(GreetingRequest request) {
  final name = request.name ?? 'World';
  final response =
      GreetingResponse(salutation: _randomSalutation(), name: name);
  return response;
}
kevmoo commented 1 week ago

Closing out in favor of https://github.com/GoogleCloudPlatform/functions-framework-dart/issues/464 – investigating now!