This repository was archived by the owner on Mar 18, 2021. It is now read-only.
This repository was archived by the owner on Mar 18, 2021. It is now read-only.
@Bind.query('--') to Enum gives "No static parse method error" while static parse method is defined in Extension on that Enum. #861
Closed
Description
enum Roles {
owner,
admin,
user,
}
extension rolesParser on Roles {
static Roles parse(String value) {
final Roles role = tryParse(value);
if (role != null)
return role;
}
static Roles tryParse(String input) {
final String value = input.trim();
return Roles.values.firstWhere((element) => element.toString().split('.')[1].toUpperCase() == value.toUpperCase());
}
}
Bad state: Bad state: Invalid binding 'role' on 'UsersController.getUsers': Parameter type does not implement static parse method.
**** Stacktrace
- #0 _enforceTypeCanBeParsedFromString (package:aqueduct/src/runtime/resource_controller_impl.dart:313:5)
- Build authentication adapter #1 ResourceControllerRuntimeImpl.getParameterForVariable (package:aqueduct/src/runtime/resource_controller_impl.dart:203:15)
- Ensure application startup completes across isolates #2 ResourceControllerRuntimeImpl.getOperationForMethod. (package:aqueduct/src/runtime/resource_controller_impl.dart:277:26)
- Documentation for application, controllers, router #3 MappedIterator.moveNext (dart:_internal/iterable.dart:395:20)
- Allow resource controller endpoints to take query params as optional arguments #4 new List.from (dart:core-patch/array_patch.dart:47:19)
- Ensure that path parameters from the router are parsed into the type the handler expects #5 Iterable.toList (dart:core/iterable.dart:400:12)
- Create API documentation intermediate file format #6 ResourceControllerRuntimeImpl.getOperationForMethod (package:aqueduct/src/runtime/resource_controller_impl.dart:281:14)
- Integrate code coverage tool for tests #7 MappedIterator.moveNext (dart:_internal/iterable.dart:395:20)
- Create Postman file from intermediate documentation #8 new List.from (dart:core-patch/array_patch.dart:47:19)
- Create Swagger API specification generated from intermediate format #9 Iterable.toList (dart:core/iterable.dart:400:12)
- Write guide for monadart #10 new ResourceControllerRuntimeImpl (package:aqueduct/src/runtime/resource_controller_impl.dart:31:10)
- Allow closures or find better way to add context to REsourceRequests in ApplicationPipeline #11 new ControllerRuntimeImpl (package:aqueduct/src/runtime/impl.dart:146:28)
- Allow HttpController methods to parse path better #12 AqueductCompiler.compile. (package:aqueduct/src/runtime/compiler.dart:21:46)
- Add RouteMatch class to encapsulate information from a Router match #13 MappedListIterable.elementAt (dart:_internal/iterable.dart:417:31)
- A big cleanup #14 ListIterator.moveNext (dart:_internal/iterable.dart:346:26)
- Fixed null pipelineOptions bug #15 MapMixin.addEntries (dart:collection/maps.dart:172:23)
- Cleaning up some stuff #16 AqueductCompiler.compile (package:aqueduct/src/runtime/compiler.dart:20:7)
- Make Application generic #17 new MirrorContext._. (package:runtime/src/mirror_context.dart:13:34)
- Added generics to app #18 List.forEach (dart:core-patch/growable_array.dart:282:8)
- Make it so JSONTestRequest can handle lists #19 new MirrorContext._ (package:runtime/src/mirror_context.dart:12:15)
- Change /auth/token/refresh to /auth/token and use grant_type #20 instance (package:runtime/src/mirror_context.dart:7:41)
- Fixed issue #20. Added x-www-form-urlencoded ContentType to default o… #21 instance (package:runtime/src/mirror_context.dart:7:16)
- Jc/responseencoder #22 RuntimeContext.current (package:runtime/src/context.dart:10:33)
- Jc/document #23 GetChannelExecutable.execute (data:application/dart:14:199)
- Jc/testing #24 main (data:application/dart:10:35)
- Allow lists to be included in input JSON, but ignore when trying to i… #25 _startIsolate. (dart:isolate-patch/isolate_patch.dart:297:32)
- Populate sub-objects in fetch request #26 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
Metadata
Metadata
Assignees
Labels
No labels