forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bump stackage This PR switches us over to the latest Stackage LTS 0.14.1 (we were on 0.13.x before, so this includes major bumps) and gets rid of some obsolete overwrites.
- v1.7.0-snapshot.20201027.5530.0.bdbf8977
- v1.7.0-snapshot.20201023.5508.0.9dec6689
- v1.7.0-snapshot.20201013.5418.0.bda13392
- v1.7.0-snapshot.20201012.5405.0.af92198d
- v1.7.0-snapshot.20201006.5358.0.0c1cadcf
- v1.6.1-snapshot.20201021.5317.0.aafe46a5
- v1.6.0
- v1.6.0-snapshot.20201012.5316.0.d21cb496
- v1.6.0-snapshot.20201007.5314.0.b4a47d0b
- v1.6.0-snapshot.20200930.5312.0.b9a1905d
- v1.6.0-snapshot.20200922.5258.0.cd4a06db
- v1.6.0-snapshot.20200915.5208.0.09014dc6
- v1.6.0-snapshot.20200908.5166.0.1623baec
- v1.5.0
- v1.5.0-snapshot.20200907.5151.0.eb68e680
- v1.5.0-snapshot.20200902.5118.0.2b3cf1b3
- v1.5.0-snapshot.20200825.5071.0.d33e130f
- v1.5.0-snapshot.20200818.5027.0.1b33d374
- v1.5.0-snapshot.20200811.4959.0.bbc2fe56
- v1.5.0-snapshot.20200804.4902.0.de2fef6b
- v1.4.0
- v1.4.0-snapshot.20200729.4851.0.224ab362
- v1.4.0-snapshot.20200724.4812.0.818a52b0
- v1.4.0-snapshot.20200722.4800.0.21a16eef
- v1.4.0-snapshot.20200722.4796.0.28ab504b
- v1.4.0-snapshot.20200715.4733.0.d6e58626
- v1.3.0
- v1.3.0-snapshot.20200714.4687.0.8e10c7a7
- v1.3.0-snapshot.20200708.4686.0.95dfa18e
- v1.3.0-snapshot.20200706.4664.0.5db06051
- v1.3.0-snapshot.20200701.4616.0.bdbefd11
- v1.3.0-snapshot.20200623.4546.0.4f68cfc4
- v1.3.0-snapshot.20200617.4484.0.7e0a6848
- v1.3.0-snapshot.20200617.4474.0.53bddb54
- v1.3.0-snapshot.20200610.4413.0.11b5c362
- v1.3.0-snapshot.20200610.4412.0.0544323d
- v1.3.0-snapshot.20200603.4345.0.1386abc0
- v1.2.0
- v1.2.0-snapshot.20200602.4310.0.1c18058f
- v1.2.0-snapshot.20200528.4309.0.f619dea3
- v1.2.0-snapshot.20200527.4268.0.acc5a21c
- v1.2.0-snapshot.20200520.4228.0.595f1e27
- v1.2.0-snapshot.20200520.4224.0.2af134ca
- v1.2.0-snapshot.20200513.4172.0.021f4af3
- v1.1.1
- v1.1.0-snapshot.20200506.4107.0.7e448d81
- v1.1.0-snapshot.20200430.4057.0.681c862d
- v1.1.0-snapshot.20200422.3991.0.6391ee9f
- v1.0.1
- v1.0.1-snapshot.20200424.3917.0.16093690
- v1.0.1-snapshot.20200417.3908.1.722bac90
- v1.0.0
- v0.13.56-snapshot.20200411.3905.0.f050da78
- v0.13.56-snapshot.20200408.3877.0.1ddcd3c0
- v0.13.56-snapshot.20200408.3871.0.b3ccacc0
- v0.13.56-snapshot.20200407.3859.0.b488b353
- v0.13.56-snapshot.20200407.3843.0.10bac143
- v0.13.56-snapshot.20200404.3816.0.30f2c742
- v0.13.56-snapshot.20200331.3729.0.b43b8d86
- v0.13.56-snapshot.20200325.3626.0.a3ddde3a
- v0.13.56-snapshot.20200318.3529.0.6ea118d6
- v0.13.55
- v0.13.55-snapshot.20200309.3401.0.6f8c3ad8
- v0.13.55-snapshot.20200304.3329.6a1c75cf
- v0.13.55-snapshot.20200226.3267.c9b9293d
- v0.13.54
- v0.13.53
- v0.13.52
- v0.13.51
- v0.13.50
- v0.13.49
- v0.13.46
- v0.13.43
- v0.13.42
- v0.13.41
- v0.13.40
- v0.13.39
- v0.13.38
- v0.13.37
- v0.13.36
- v0.13.35
- v0.13.34
- v0.13.33
- v0.13.32
- v0.13.31
- v0.13.30
- v0.13.29
- v0.13.27
- v0.13.26
- v0.13.25
- v0.13.24
- v0.13.23
- v0.13.22
- v0.13.21
- v0.13.20
1 parent
67d4b7a
commit b4dc886
Showing
4 changed files
with
2,337 additions
and
1,585 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
diff --git a/proto3-suite.cabal b/proto3-suite.cabal | ||
index 8ef63e9..08d40ca 100644 | ||
--- a/proto3-suite.cabal | ||
+++ b/proto3-suite.cabal | ||
@@ -65,7 +65,7 @@ library | ||
quickcheck-instances < 0.4, | ||
safe ==0.3.*, | ||
semigroups ==0.18.*, | ||
- swagger2 >=2.1.6 && <2.4, | ||
+ swagger2 >=2.1.6 && <2.5, | ||
system-filepath, | ||
text >= 0.2 && <1.3, | ||
transformers >=0.4 && <0.6, | ||
diff --git a/src/Proto3/Suite/DotProto/Generate.hs b/src/Proto3/Suite/DotProto/Generate.hs | ||
index 2cf78cd..03faf3b 100644 | ||
--- a/src/Proto3/Suite/DotProto/Generate.hs | ||
+++ b/src/Proto3/Suite/DotProto/Generate.hs | ||
@@ -1023,7 +1023,11 @@ toSchemaInstanceDeclaration messageName maybeConstructors fieldNames = do | ||
where | ||
_paramSchemaType = jsonpbName "_paramSchemaType" | ||
|
||
+#if MIN_VERSION_swagger2(2,4,0) | ||
+ _paramSchemaTypeExpression = HsApp justC (HsVar (jsonpbName "SwaggerObject")) | ||
+#else | ||
_paramSchemaTypeExpression = HsVar (jsonpbName "SwaggerObject") | ||
+#endif | ||
|
||
let _schemaParamSchemaExpression = HsRecUpdate memptyE paramSchemaUpdates | ||
|
||
diff --git a/src/Proto3/Suite/DotProto/Generate/Swagger.hs b/src/Proto3/Suite/DotProto/Generate/Swagger.hs | ||
index 6c6962a..17adf90 100644 | ||
--- a/src/Proto3/Suite/DotProto/Generate/Swagger.hs | ||
+++ b/src/Proto3/Suite/DotProto/Generate/Swagger.hs | ||
@@ -1,3 +1,4 @@ | ||
+{-# LANGUAGE CPP #-} | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE FlexibleInstances #-} | ||
{-# LANGUAGE FlexibleContexts #-} | ||
@@ -17,7 +18,11 @@ module Proto3.Suite.DotProto.Generate.Swagger | ||
) | ||
where | ||
|
||
+#if MIN_VERSION_swagger2(2,4,0) | ||
+import Control.Lens ((&), (?~)) | ||
+#else | ||
import Control.Lens ((&), (.~), (?~)) | ||
+#endif | ||
import Data.Aeson (Value (String)) | ||
import Data.Aeson.Encode.Pretty (encodePretty) | ||
import Data.ByteString (ByteString) | ||
@@ -55,7 +60,11 @@ instance {-# OVERLAPPING #-} ToSchema (OverrideToSchema (V.Vector ByteString)) w | ||
declareNamedSchema _ = return (NamedSchema Nothing schema_) | ||
where | ||
schema_ = mempty | ||
+#if MIN_VERSION_swagger2(2,4,0) | ||
+ & type_ ?~ SwaggerArray | ||
+#else | ||
& type_ .~ SwaggerArray | ||
+#endif | ||
& items ?~ SwaggerItemsObject (Inline byteSchema) | ||
|
||
{-| This is a convenience function that uses type inference to select the | ||
@@ -66,7 +75,7 @@ asProxy _ = Proxy | ||
|
||
-- | Pretty-prints a schema. Useful when playing around with schemas in the | ||
-- REPL. | ||
-ppSchema :: ToSchema a => proxy a -> IO () | ||
+ppSchema :: ToSchema a => Proxy a -> IO () | ||
ppSchema = LC8.putStrLn . encodePretty . toSchema | ||
|
||
-- | JSONPB schemas for protobuf enumerations | ||
@@ -77,7 +86,11 @@ instance (Finite e, Named e) => ToSchema (Enumerated e) where | ||
let enumMemberNames = dropPrefix . fst <$> enumerate (proxy# :: Proxy# e) | ||
return $ NamedSchema (Just enumName) | ||
$ mempty | ||
+#if MIN_VERSION_swagger2(2,4,0) | ||
+ & type_ ?~ SwaggerString | ||
+#else | ||
& type_ .~ SwaggerString | ||
+#endif | ||
& enum_ ?~ fmap String enumMemberNames | ||
|
||
instance ToSchema (Fixed Int32) where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.