mirror of
https://code.sup39.dev/repos/Wqawg
synced 2025-03-20 04:46:22 +09:00
Allow actor public key to be in a separate document
This commit is contained in:
parent
8db38c087f
commit
c336d56036
5 changed files with 88 additions and 43 deletions
src/Data/Aeson
|
@ -14,7 +14,8 @@
|
|||
-}
|
||||
|
||||
module Data.Aeson.Local
|
||||
( frg
|
||||
( Either' (..)
|
||||
, frg
|
||||
, parseHttpsURI
|
||||
, renderURI
|
||||
, (.=?)
|
||||
|
@ -23,6 +24,7 @@ where
|
|||
|
||||
import Prelude
|
||||
|
||||
import Control.Applicative ((<|>))
|
||||
import Data.Aeson
|
||||
import Data.Aeson.Types (Parser)
|
||||
import Data.Text (Text)
|
||||
|
@ -30,6 +32,11 @@ import Network.URI
|
|||
|
||||
import qualified Data.Text as T (unpack)
|
||||
|
||||
data Either' a b = Left' a | Right' b
|
||||
|
||||
instance (FromJSON a, FromJSON b) => FromJSON (Either' a b) where
|
||||
parseJSON v = Left' <$> parseJSON v <|> Right' <$> parseJSON v
|
||||
|
||||
frg :: Text
|
||||
frg = "https://forgefed.angeley.es/ns#"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue