Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Optional query params aqueduct

Tags:

aqueduct

Went through the documentation, couldn't find any.

How does one make an optional query param in aqueduct?

like image 950
KhoPhi Avatar asked Aug 05 '26 03:08

KhoPhi


1 Answers

By wrapping an argument in curly brackets:

@Operation.get()
Future<Response> getAllCities({@Bind.header('x-api-key') String apiKey}) async 
{}

This is documented here: http://aqueduct.io/docs/http/resource_controller/#optional-bindings

like image 114
Joe Conway Avatar answered Aug 08 '26 15:08

Joe Conway