aeson-jsonpath 0.4.1.0 → 0.4.2.0
raw patch · 20 files changed
+45/−94 lines, 20 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.Aeson.JSONPath.Parser: pBasicExpr :: Parser a -> Parser (BasicExpr a)
+ Data.Aeson.JSONPath.Parser: pBracketed :: Parser a -> Parser (Segment a)
+ Data.Aeson.JSONPath.Parser: pCompSQ :: Parser Comparable
+ Data.Aeson.JSONPath.Parser: pComparable :: Parser Comparable
+ Data.Aeson.JSONPath.Parser: pComparisonExpr :: Parser (BasicExpr a)
+ Data.Aeson.JSONPath.Parser: pComparisonOp :: Parser ComparisonOp
+ Data.Aeson.JSONPath.Parser: pCurrentQuery :: Parser Query
+ Data.Aeson.JSONPath.Parser: pCurrentSingleQ :: Parser SingularQuery
+ Data.Aeson.JSONPath.Parser: pDotted :: Bool -> Parser (Segment a)
+ Data.Aeson.JSONPath.Parser: pDoubleQuotted :: Parser String
+ Data.Aeson.JSONPath.Parser: pDoubleScientific :: Parser Scientific
+ Data.Aeson.JSONPath.Parser: pEscaped :: Parser Char
+ Data.Aeson.JSONPath.Parser: pExponent :: Parser Int
+ Data.Aeson.JSONPath.Parser: pFilter :: Parser a -> Parser (Selector a)
+ Data.Aeson.JSONPath.Parser: pFunctionArg :: Parser a -> Parser (FunctionArg a)
+ Data.Aeson.JSONPath.Parser: pFunctionExpr :: Parser a -> Parser (FunctionExpr a)
+ Data.Aeson.JSONPath.Parser: pHexUnicode :: Parser Char
+ Data.Aeson.JSONPath.Parser: pIndex :: Parser (Selector a)
+ Data.Aeson.JSONPath.Parser: pLitBool :: Parser Literal
+ Data.Aeson.JSONPath.Parser: pLitNull :: Parser Literal
+ Data.Aeson.JSONPath.Parser: pLitNum :: Parser Literal
+ Data.Aeson.JSONPath.Parser: pLitString :: Parser Literal
+ Data.Aeson.JSONPath.Parser: pLiteral :: Parser Literal
+ Data.Aeson.JSONPath.Parser: pLogicalAndExpr :: Parser a -> Parser (LogicalAndExpr a)
+ Data.Aeson.JSONPath.Parser: pLogicalOrExpr :: Parser a -> Parser (LogicalOrExpr a)
+ Data.Aeson.JSONPath.Parser: pName :: Parser (Selector a)
+ Data.Aeson.JSONPath.Parser: pParenExpr :: Parser a -> Parser (BasicExpr a)
+ Data.Aeson.JSONPath.Parser: pQuerySegment :: Parser a -> Parser (QuerySegment a)
+ Data.Aeson.JSONPath.Parser: pRootQuery :: Parser Query
+ Data.Aeson.JSONPath.Parser: pRootSingleQ :: Parser SingularQuery
+ Data.Aeson.JSONPath.Parser: pScientific :: Parser Scientific
+ Data.Aeson.JSONPath.Parser: pSegment :: Parser a -> Bool -> Parser (Segment a)
+ Data.Aeson.JSONPath.Parser: pSelector :: Parser a -> Parser (Selector a)
+ Data.Aeson.JSONPath.Parser: pSignedInt :: Parser Int
+ Data.Aeson.JSONPath.Parser: pSingleQuotted :: Parser String
+ Data.Aeson.JSONPath.Parser: pSingularQIndexSeg :: Parser SingularQuerySegment
+ Data.Aeson.JSONPath.Parser: pSingularQNameSeg :: Parser SingularQuerySegment
+ Data.Aeson.JSONPath.Parser: pSingularQuerySegment :: Parser SingularQuerySegment
+ Data.Aeson.JSONPath.Parser: pSlice :: Parser (Selector a)
+ Data.Aeson.JSONPath.Parser: pSpaces :: Parser [Char]
+ Data.Aeson.JSONPath.Parser: pTestExpr :: Parser a -> Parser (BasicExpr a)
+ Data.Aeson.JSONPath.Parser: pUnescaped :: Parser Char
+ Data.Aeson.JSONPath.Parser: pUnicodeChar :: Parser Char
+ Data.Aeson.JSONPath.Parser: pWildcardSeg :: Bool -> Parser (Segment a)
+ Data.Aeson.JSONPath.Parser: pWildcardSel :: Parser (Selector a)
+ Data.Aeson.JSONPath.Query: allElemsRecursive :: Value -> Vector Value
+ Data.Aeson.JSONPath.Query: allElemsRecursiveLocated :: (String, Value) -> Vector (String, Value)
+ Data.Aeson.JSONPath.Query: compareVals :: ComparisonOp -> Maybe Value -> Maybe Value -> Bool
+ Data.Aeson.JSONPath.Query: dumpBasicExpr :: BasicExpr Query -> Text
+ Data.Aeson.JSONPath.Query: dumpComparable :: Comparable -> Text
+ Data.Aeson.JSONPath.Query: dumpComparisonExpr :: ComparisonExpr -> Text
+ Data.Aeson.JSONPath.Query: dumpComparisonOp :: ComparisonOp -> Text
+ Data.Aeson.JSONPath.Query: dumpFunctionArg :: FunctionArg Query -> Text
+ Data.Aeson.JSONPath.Query: dumpFunctionExpr :: FunctionExpr Query -> Text
+ Data.Aeson.JSONPath.Query: dumpLiteral :: Literal -> Text
+ Data.Aeson.JSONPath.Query: dumpLogicalAndExpr :: LogicalAndExpr Query -> Text
+ Data.Aeson.JSONPath.Query: dumpLogicalOrExpr :: LogicalOrExpr Query -> Text
+ Data.Aeson.JSONPath.Query: dumpQuerySegment :: QuerySegment Query -> Text
+ Data.Aeson.JSONPath.Query: dumpSegment :: Bool -> Segment Query -> Text
+ Data.Aeson.JSONPath.Query: dumpSelector :: Selector Query -> Text
+ Data.Aeson.JSONPath.Query: dumpSingularQ :: SingularQuery -> Text
+ Data.Aeson.JSONPath.Query: dumpSingularQSegment :: SingularQuerySegment -> Text
+ Data.Aeson.JSONPath.Query: dumpTestExpr :: TestExpr Query -> Text
+ Data.Aeson.JSONPath.Query: evaluateBasicExpr :: BasicExpr Query -> QueryState -> Bool
+ Data.Aeson.JSONPath.Query: evaluateCompExpr :: ComparisonExpr -> QueryState -> Bool
+ Data.Aeson.JSONPath.Query: evaluateFunctionExpr :: FunctionExpr Query -> QueryState -> FunctionResult
+ Data.Aeson.JSONPath.Query: evaluateLogicalAndExpr :: LogicalAndExpr Query -> QueryState -> Bool
+ Data.Aeson.JSONPath.Query: evaluateLogicalOrExpr :: LogicalOrExpr Query -> QueryState -> Bool
+ Data.Aeson.JSONPath.Query: evaluateSearchFunction :: (FunctionArg Query, FunctionArg Query) -> QueryState -> FunctionResult
+ Data.Aeson.JSONPath.Query: evaluateTestExpr :: TestExpr Query -> QueryState -> Bool
+ Data.Aeson.JSONPath.Query: filterOrExpr :: LogicalOrExpr Query -> QueryState -> Vector Value
+ Data.Aeson.JSONPath.Query: filterOrExprLocated :: LogicalOrExpr Query -> QueryState -> String -> Vector (String, Value)
+ Data.Aeson.JSONPath.Query: getComparableVal :: Comparable -> QueryState -> Maybe Value
+ Data.Aeson.JSONPath.Query: lookupSingleQSeg :: Maybe Value -> SingularQuerySegment -> Maybe Value
+ Data.Aeson.JSONPath.Query: qQuerySegment :: QuerySegment Query -> QueryState -> Vector Value
+ Data.Aeson.JSONPath.Query: qQuerySegmentLocated :: QuerySegment Query -> QueryState -> String -> Vector (String, Value)
+ Data.Aeson.JSONPath.Query: qSegment :: Segment Query -> QueryState -> Vector Value
+ Data.Aeson.JSONPath.Query: qSegmentLocated :: Segment Query -> QueryState -> String -> Vector (String, Value)
+ Data.Aeson.JSONPath.Query: qSelector :: Selector Query -> QueryState -> Vector Value
+ Data.Aeson.JSONPath.Query: qSelectorLocated :: Selector Query -> QueryState -> String -> Vector (String, Value)
+ Data.Aeson.JSONPath.Query: sliceArray :: (Maybe Int, Maybe Int, Int) -> Vector Value -> Vector Value
+ Data.Aeson.JSONPath.Query: sliceArrayLocated :: (Maybe Int, Maybe Int, Int) -> Vector (String, Value) -> Vector (String, Value)
+ Data.Aeson.JSONPath.Query: toPathIdx :: String -> Int -> String
+ Data.Aeson.JSONPath.Query: toPathKey :: String -> Key -> String
+ Data.Aeson.JSONPath.Query: traverseSingularQSegs :: Maybe Value -> [SingularQuerySegment] -> Maybe Value
Files
- CHANGELOG.md +4/−0
- LICENSE +1/−1
- README.md +1/−1
- aeson-jsonpath.cabal +2/−1
- src/Data/Aeson/JSONPath/Parser.hs +12/−12
- src/Data/Aeson/JSONPath/Parser/Common.hs +1/−5
- src/Data/Aeson/JSONPath/Parser/Filter.hs +1/−3
- src/Data/Aeson/JSONPath/Parser/Name.hs +1/−5
- src/Data/Aeson/JSONPath/Parser/Number.hs +1/−6
- src/Data/Aeson/JSONPath/Parser/Query.hs +5/−4
- src/Data/Aeson/JSONPath/Query.hs +6/−0
- src/Data/Aeson/JSONPath/Query/DumpQuery.hs +1/−3
- src/Data/Aeson/JSONPath/Query/Filter.hs +1/−4
- src/Data/Aeson/JSONPath/Query/Query.hs +1/−5
- src/Data/Aeson/JSONPath/Query/Segment.hs +2/−6
- src/Data/Aeson/JSONPath/Query/Selector.hs +1/−5
- src/Data/Aeson/JSONPath/Types/Filter.hs +1/−18
- src/Data/Aeson/JSONPath/Types/Query.hs +1/−6
- src/Data/Aeson/JSONPath/Types/Segment.hs +1/−6
- src/Data/Aeson/JSONPath/Types/Selector.hs +1/−3
CHANGELOG.md view
@@ -2,6 +2,10 @@ All notable changes to this package are documented in this file. This project adheres to [Haskell PVP](https://pvp.haskell.org/) versioning. +## 0.4.2.0++- #87, Expose internal functions+ ## 0.4.1.0 - #85, Implement `dumpQuery` to dump JSONPath query
LICENSE view
@@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024-2025 Taimoor Zaeem+Copyright (c) 2024-2026 Taimoor Zaeem Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
README.md view
@@ -1,6 +1,6 @@ # aeson-jsonpath -[](https://github.com/taimoorzaeem/aeson-jsonpath/actions/workflows/build.yml) [](https://hackage.haskell.org/package/aeson-jsonpath) [](https://github.com/taimoorzaeem/aeson-jsonpath/actions/workflows/compliance.yml)+[](https://github.com/taimoorzaeem/aeson-jsonpath/actions/workflows/build.yml) [](https://hackage.haskell.org/package/aeson-jsonpath) [](https://github.com/taimoorzaeem/aeson-jsonpath/actions/workflows/compliance.yml) Run [RFC 9535](https://www.rfc-editor.org/rfc/rfc9535) compliant JSONPath queries on [Data.Aeson](https://hackage.haskell.org/package/aeson).
aeson-jsonpath.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: aeson-jsonpath-version: 0.4.1.0+version: 0.4.2.0 synopsis: Parse and run JSONPath queries on Aeson documents description: RFC 9535 compliant JSONPath parsing and querying package. JSONPath is similar to XPath for querying@@ -90,6 +90,7 @@ main-is: Main.hs other-modules: ComplianceSpec Paths_aeson_jsonpath+ -- required by cabal spec 3.0 autogen-modules: Paths_aeson_jsonpath build-depends: aeson >= 2.0.3 && < 2.5 , aeson-jsonpath
src/Data/Aeson/JSONPath/Parser.hs view
@@ -11,17 +11,17 @@ This module is responsible for parsing the JSONPath query -} module Data.Aeson.JSONPath.Parser- ( pQuery )+ (+ module Data.Aeson.JSONPath.Parser.Query+ , module Data.Aeson.JSONPath.Parser.Name+ , module Data.Aeson.JSONPath.Parser.Number+ , module Data.Aeson.JSONPath.Parser.Filter+ , module Data.Aeson.JSONPath.Parser.Common+ ) where -import qualified Text.ParserCombinators.Parsec as P--import Data.Aeson.JSONPath.Query ()-import Data.Aeson.JSONPath.Parser.Query (pRootQuery)-import Data.Aeson.JSONPath.Types--import Prelude---- | Query parser-pQuery :: P.Parser Query-pQuery = pRootQuery <* P.eof+import Data.Aeson.JSONPath.Parser.Query+import Data.Aeson.JSONPath.Parser.Name+import Data.Aeson.JSONPath.Parser.Number+import Data.Aeson.JSONPath.Parser.Filter+import Data.Aeson.JSONPath.Parser.Common
src/Data/Aeson/JSONPath/Parser/Common.hs view
@@ -1,8 +1,4 @@-module Data.Aeson.JSONPath.Parser.Common- ( pSpaces- , pUnicodeChar- )- where+module Data.Aeson.JSONPath.Parser.Common where import qualified Text.ParserCombinators.Parsec as P import Text.ParserCombinators.Parsec ((<?>))
src/Data/Aeson/JSONPath/Parser/Filter.hs view
@@ -1,7 +1,5 @@ {-# OPTIONS_GHC -Wno-unused-do-bind #-}-module Data.Aeson.JSONPath.Parser.Filter- ( pFilter )- where+module Data.Aeson.JSONPath.Parser.Filter where import qualified Data.Text as T import qualified Text.ParserCombinators.Parsec as P
src/Data/Aeson/JSONPath/Parser/Name.hs view
@@ -1,9 +1,5 @@ {-# OPTIONS_GHC -Wno-unused-do-bind #-}-module Data.Aeson.JSONPath.Parser.Name- ( pSingleQuotted- , pDoubleQuotted- )- where+module Data.Aeson.JSONPath.Parser.Name where import qualified Text.ParserCombinators.Parsec as P
src/Data/Aeson/JSONPath/Parser/Number.hs view
@@ -1,10 +1,5 @@ {-# OPTIONS_GHC -Wno-unused-do-bind #-}-module Data.Aeson.JSONPath.Parser.Number- ( pSignedInt- , pScientific- , pDoubleScientific- )- where+module Data.Aeson.JSONPath.Parser.Number where import qualified Text.ParserCombinators.Parsec as P
src/Data/Aeson/JSONPath/Parser/Query.hs view
@@ -1,8 +1,5 @@ {-# OPTIONS_GHC -Wno-unused-do-bind #-}-module Data.Aeson.JSONPath.Parser.Query- ( pRootQuery- , pCurrentQuery )- where+module Data.Aeson.JSONPath.Parser.Query where import qualified Data.Text as T import qualified Text.ParserCombinators.Parsec as P@@ -18,6 +15,10 @@ import Data.Aeson.JSONPath.Types import Prelude++-- | Query parser+pQuery :: P.Parser Query+pQuery = pRootQuery <* P.eof pRootQuery :: P.Parser Query pRootQuery = do
src/Data/Aeson/JSONPath/Query.hs view
@@ -12,9 +12,15 @@ module Data.Aeson.JSONPath.Query ( module Data.Aeson.JSONPath.Query.Query+ , module Data.Aeson.JSONPath.Query.Segment+ , module Data.Aeson.JSONPath.Query.Selector+ , module Data.Aeson.JSONPath.Query.Filter , module Data.Aeson.JSONPath.Query.DumpQuery ) where import Data.Aeson.JSONPath.Query.Query+import Data.Aeson.JSONPath.Query.Segment+import Data.Aeson.JSONPath.Query.Selector hiding (toPathKey)+import Data.Aeson.JSONPath.Query.Filter import Data.Aeson.JSONPath.Query.DumpQuery
src/Data/Aeson/JSONPath/Query/DumpQuery.hs view
@@ -1,8 +1,6 @@ {-# LANGUAGE LambdaCase #-} {-# LANGUAGE RecordWildCards #-}-module Data.Aeson.JSONPath.Query.DumpQuery- ( dumpQuery )- where+module Data.Aeson.JSONPath.Query.DumpQuery where import Data.Text (Text)
src/Data/Aeson/JSONPath/Query/Filter.hs view
@@ -1,8 +1,5 @@ {-# LANGUAGE RecordWildCards #-}-module Data.Aeson.JSONPath.Query.Filter- ( filterOrExpr- , filterOrExprLocated )- where+module Data.Aeson.JSONPath.Query.Filter where import Data.Aeson (Value) import Data.Vector (Vector)
src/Data/Aeson/JSONPath/Query/Query.hs view
@@ -1,9 +1,5 @@ {-# LANGUAGE RecordWildCards #-}-module Data.Aeson.JSONPath.Query.Query- ( qQuery- , qQueryLocated- )- where+module Data.Aeson.JSONPath.Query.Query where import Control.Monad (join) import Data.Aeson (Value)
src/Data/Aeson/JSONPath/Query/Segment.hs view
@@ -1,9 +1,5 @@ {-# LANGUAGE RecordWildCards #-}-module Data.Aeson.JSONPath.Query.Segment- ( qQuerySegment- , qQuerySegmentLocated- )- where+module Data.Aeson.JSONPath.Query.Segment where import Control.Monad (join) import Data.Aeson (Value)@@ -15,7 +11,7 @@ import qualified Data.Vector as V import Data.Aeson.JSONPath.Types-import Data.Aeson.JSONPath.Query.Selector+import Data.Aeson.JSONPath.Query.Selector hiding (toPathKey) import Prelude
src/Data/Aeson/JSONPath/Query/Selector.hs view
@@ -1,9 +1,5 @@ {-# LANGUAGE RecordWildCards #-}-module Data.Aeson.JSONPath.Query.Selector- ( qSelector- , qSelectorLocated- )- where+module Data.Aeson.JSONPath.Query.Selector where import Data.Aeson (Value) import Data.Vector (Vector)
src/Data/Aeson/JSONPath/Types/Filter.hs view
@@ -1,22 +1,5 @@ {-# LANGUAGE DeriveLift #-}-module Data.Aeson.JSONPath.Types.Filter- (LogicalOrExpr (..)- , LogicalAndExpr (..)- , BasicExpr (..)- , TestExpr (..)- , ComparisonExpr (..)- , ComparisonOp (..)- , Comparable (..)- , Literal (..)- , SingularQueryType (..)- , SingularQuery (..)- , SingularQuerySegment (..)- , FunctionExpr (..)- , FunctionName (..)- , FunctionArg (..)- , FunctionResult (..)- )- where+module Data.Aeson.JSONPath.Types.Filter where import Data.Aeson (Value) import Data.Text (Text)
src/Data/Aeson/JSONPath/Types/Query.hs view
@@ -1,10 +1,5 @@ {-# LANGUAGE DeriveLift #-}-module Data.Aeson.JSONPath.Types.Query- ( Query (..)- , QueryType (..)- , QueryState (..)- )- where+module Data.Aeson.JSONPath.Types.Query where import Data.Aeson (Value) import Data.Vector (Vector)
src/Data/Aeson/JSONPath/Types/Segment.hs view
@@ -1,10 +1,5 @@ {-# LANGUAGE DeriveLift #-}-module Data.Aeson.JSONPath.Types.Segment- (Segment (..)- , QuerySegment (..)- , SegmentType (..)- )- where+module Data.Aeson.JSONPath.Types.Segment where import Data.Aeson.JSONPath.Types.Selector (Selector (..)) import Data.Text (Text)
src/Data/Aeson/JSONPath/Types/Selector.hs view
@@ -1,7 +1,5 @@ {-# LANGUAGE DeriveLift #-}-module Data.Aeson.JSONPath.Types.Selector- (Selector (..))- where+module Data.Aeson.JSONPath.Types.Selector where import Data.Aeson.JSONPath.Types.Filter (LogicalOrExpr (..)) import Data.Text (Text)