diff --git a/packages/cedar/lib/src/authorization/cedar_authorization_response.dart b/packages/cedar/lib/src/authorization/cedar_authorization_response.dart index 6dffe37f..d91d3a85 100644 --- a/packages/cedar/lib/src/authorization/cedar_authorization_response.dart +++ b/packages/cedar/lib/src/authorization/cedar_authorization_response.dart @@ -1,7 +1,14 @@ import 'package:cedar/cedar.dart'; +import 'package:json_annotation/json_annotation.dart'; /// The decision of an authorization request. -enum CedarAuthorizationDecision { allow, deny } +enum CedarAuthorizationDecision { + @JsonValue('Allow') + allow, + + @JsonValue('Deny') + deny, +} /// {@template cedar.cedar_authorization_response} /// The response to a [CedarAuthorizer] request. diff --git a/packages/cedar/pubspec.yaml b/packages/cedar/pubspec.yaml index c3a3f720..4bebfe8d 100644 --- a/packages/cedar/pubspec.yaml +++ b/packages/cedar/pubspec.yaml @@ -9,6 +9,7 @@ dependencies: built_collection: ^5.1.1 built_value: ^8.9.1 collection: ^1.18.0 + json_annotation: ^4.8.1 meta: ^1.11.0 dev_dependencies: