From 78785ae513395b959274624d65db9b9244c149ad Mon Sep 17 00:00:00 2001 From: Sameer Kolhar Date: Fri, 5 Mar 2021 18:56:00 +0530 Subject: [PATCH] server: fix fromJSON for RemoteSchemaPermsCtx GitOrigin-RevId: a0a6d50a39ffbc7fab0a303b50c3e2c485954773 --- server/src-lib/Hasura/RQL/Types/RemoteSchema.hs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/server/src-lib/Hasura/RQL/Types/RemoteSchema.hs b/server/src-lib/Hasura/RQL/Types/RemoteSchema.hs index 17c97f71025..2a7003f362e 100644 --- a/server/src-lib/Hasura/RQL/Types/RemoteSchema.hs +++ b/server/src-lib/Hasura/RQL/Types/RemoteSchema.hs @@ -200,11 +200,8 @@ data RemoteSchemaPermsCtx deriving (Show, Eq) instance J.FromJSON RemoteSchemaPermsCtx where - parseJSON = J.withText "RemoteSchemaPermsCtx" $ \t -> - case T.toLower t of - "true" -> pure RemoteSchemaPermsEnabled - "false" -> pure RemoteSchemaPermsDisabled - _ -> fail "enable_remote_schema_permissions should be a boolean value" + parseJSON = J.withBool "RemoteSchemaPermsCtx" $ + pure . bool RemoteSchemaPermsDisabled RemoteSchemaPermsEnabled instance J.ToJSON RemoteSchemaPermsCtx where toJSON = \case