You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 18, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 18, 2021. It is now read-only.
Allow resource controller endpoints to take query params as optional arguments #4
An endpoint could have optional arguments to automatically grab query parameters. These shouldn't impact routing or which handler gets the query parameters. A signature for a handler could then look like this:
Activity
itsjoeconway commentedon Aug 26, 2015
Implemented in 40dc2d8
seanmavley commentedon Apr 12, 2019
Good!
Now, how does one construct the URL?
example.com/search?limit=5&page=10how would that be constructed to be optional?The routing doc here, https://aqueduct.io/docs/http/routing/ doesn't mention anything about query params routes construction
EddieKamau commentedon Apr 13, 2020
By wrapping an argument in curly brackets:
This is documented here: http://aqueduct.io/docs/http/resource_controller/#optional-bindings
evertonfoz commentedon Jun 20, 2020
@EddieKamau , when I use
@Operation.get()Future<Response> foo({@Bind.query('q') String name}) async {}and don´t send any query parameters, I receive the
The method '[]' was called on null.Tried calling: []("q") #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)Can you help me please?