From 4b9ca79ddc9c1095dec9c561eabf891f835698fb Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Mon, 5 Feb 2024 11:56:07 -0800 Subject: [PATCH] Add Name ToJSONKey instance --- unison-share-api/src/Unison/Server/Orphans.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unison-share-api/src/Unison/Server/Orphans.hs b/unison-share-api/src/Unison/Server/Orphans.hs index 8455e265f8..a3d8ce22c8 100644 --- a/unison-share-api/src/Unison/Server/Orphans.hs +++ b/unison-share-api/src/Unison/Server/Orphans.hs @@ -169,6 +169,9 @@ instance ToJSON Name where toEncoding = toEncoding . Name.toText toJSON = toJSON . Name.toText +instance ToJSONKey Name where + toJSONKey = contramap Name.toText (toJSONKey @Text) + instance ToSchema Name where declareNamedSchema _ = declareNamedSchema (Proxy @Text)