rest-gen 0.14 → 0.14.1
raw patch · 5 files changed
+26/−8 lines, 5 filesdep ~Cabal
Dependency ranges changed: Cabal
Files
- CHANGELOG.md +6/−0
- rest-gen.cabal +4/−3
- src/Rest/Gen/Base/ActionInfo.hs +1/−0
- src/Rest/Gen/Base/ApiTree.hs +1/−0
- tests/Runner.hs +14/−5
CHANGELOG.md view
@@ -1,5 +1,11 @@ # Changelog +### 0.14.1++* Expose modules Rest.Gen.Base.ActionInfo and Rest.Gen.Base.ApiTree+ again.+* Make test cases compile again.+ ## 0.14 * Abstracted generated code into rest-client, you should regenerate haskell clients
rest-gen.cabal view
@@ -1,5 +1,5 @@ name: rest-gen-version: 0.14+version: 0.14.1 description: Documentation and client generation from rest definition. synopsis: Documentation and client generation from rest definition. maintainer: code@silk.co@@ -30,6 +30,8 @@ exposed-modules: Rest.Gen Rest.Gen.Base+ Rest.Gen.Base.ActionInfo+ Rest.Gen.Base.ApiTree Rest.Gen.Config Rest.Gen.Docs Rest.Gen.Haskell@@ -38,9 +40,7 @@ Rest.Gen.Types other-modules: Paths_rest_gen- Rest.Gen.Base.ActionInfo Rest.Gen.Base.ActionInfo.Ident- Rest.Gen.Base.ApiTree Rest.Gen.Base.JSON Rest.Gen.Base.JSON.Pretty Rest.Gen.Base.Link@@ -81,6 +81,7 @@ build-depends: base >= 4.5 && < 4.8 , HUnit == 1.2.*+ , haskell-src-exts >= 1.15.0 && < 1.16.0 , rest-core == 0.31.* , rest-gen , test-framework == 0.8.*
src/Rest/Gen/Base/ActionInfo.hs view
@@ -7,6 +7,7 @@ ( Accessor , ActionInfo (..) , ActionType (..)+ , ActionTarget (..) , DataDescription (..) , DataType (..) , ResourceId
src/Rest/Gen/Base/ApiTree.hs view
@@ -8,6 +8,7 @@ , allTrees , apiResources , apiSubtrees+ , apiTree , apiTree' , cleanName , defaultTree
tests/Runner.hs view
@@ -1,9 +1,15 @@+{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE ScopedTypeVariables, OverloadedStrings #-} +import Data.String import Test.Framework (defaultMain) import Test.Framework.Providers.HUnit (testCase) import Test.HUnit (Assertion, assertEqual) +import qualified Language.Haskell.Exts.Parser as H+import qualified Language.Haskell.Exts.Syntax as H++import Rest.Api import Rest.Gen.Base.ActionInfo import Rest.Gen.Base.ApiTree import Rest.Dictionary (xmlJsonO)@@ -24,7 +30,7 @@ where [actionInfo] = resourceToActionInfo resource resource :: Resource IO IO Void () Void- resource = mkResource { name = "resource", schema = Schema (Just (Many ())) (Named []), list = listHandler }+ resource = mkResourceId { name = "resource", schema = Schema (Just (Many ())) (Named []), list = listHandler } listHandler () = mkListing id $ \_ -> return [] testSingleSelect :: Assertion@@ -32,7 +38,7 @@ where actionInfos = filter isSelect $ resourceToActionInfo resource resource :: Resource IO IO ServerId Void Void- resource = mkResource+ resource = mkResourceId { name = "resource" , schema = noListing $ named@@ -50,7 +56,7 @@ where actionInfos = filter isRemove $ resourceToActionInfo resource resource :: Resource IO IO ServerId Void Void- resource = mkResource+ resource = mkResourceId { name = "resource" , schema = noListing $ named@@ -67,10 +73,13 @@ testListingType :: Assertion testListingType = assertEqual "Listing should have List type"- "Rest.Types.Container.List (())"+ (Just "Rest.Types.Container.List (())") (haskellType . head . outputs . itemInfo . head . resItems $ api) where api = apiTree (route resource) resource :: Resource IO IO Void () Void- resource = mkResource { name = "resource", schema = Schema (Just (Many ())) (Named []), list = listHandler }+ resource = mkResourceId { name = "resource", schema = Schema (Just (Many ())) (Named []), list = listHandler } listHandler () = mkListing xmlJsonO $ \_ -> return [()]++instance IsString H.Type where+ fromString = H.fromParseResult . H.parse