git.iko.soy/typeable/swagger2
on master help sign in
Merge pull request #189 from felixonmars/generics-sop-0.5

Fix compatibility with generics-sop 0.5

commitcf4b03b0efb2198f75be738fa6c766c8b593b9d4 authorOleg Grenrus <oleg.grenrus@iki.fi> dateFri 17 May 2019, 09:00 (7 years ago) parent6448fcf96420ab
2 files changed+13−1
src/Data/Swagger/Internal/AesonUtils.hs+12 swagger2.cabal+1−1
src/Data/Swagger/Internal/AesonUtils.hs+12
@@ -144,7 +144,11 @@ sopSwaggerGenericToJSON'
144144 -> DatatypeInfo '[xs]
145145 -> POP Maybe '[xs]
146146 -> [Pair]
147+#if MIN_VERSION_generics_sop(0,5,0)
148+sopSwaggerGenericToJSON' opts (SOP (Z fields)) (ADT _ _ (Record _ fieldsInfo :* Nil) _) (POP (defs :* Nil)) =
149+#else
147150sopSwaggerGenericToJSON' opts (SOP (Z fields)) (ADT _ _ (Record _ fieldsInfo :* Nil)) (POP (defs :* Nil)) =
151+#endif
148152 sopSwaggerGenericToJSON'' opts fields fieldsInfo defs
149153sopSwaggerGenericToJSON' _ _ _ _ = error "sopSwaggerGenericToJSON: unsupported type"
150154
@@ -220,7 +224,11 @@ sopSwaggerGenericParseJSON'
220224 -> DatatypeInfo '[xs]
221225 -> POP Maybe '[xs]
222226 -> Parser (SOP I '[xs])
227+#if MIN_VERSION_generics_sop(0,5,0)
228+sopSwaggerGenericParseJSON' opts obj (ADT _ _ (Record _ fieldsInfo :* Nil) _) (POP (defs :* Nil)) =
229+#else
223230sopSwaggerGenericParseJSON' opts obj (ADT _ _ (Record _ fieldsInfo :* Nil)) (POP (defs :* Nil)) =
231+#endif
224232 SOP . Z <$> sopSwaggerGenericParseJSON'' opts obj fieldsInfo defs
225233sopSwaggerGenericParseJSON' _ _ _ _ = error "sopSwaggerGenericParseJSON: unsupported type"
226234
@@ -292,7 +300,11 @@ sopSwaggerGenericToEncoding'
292300 -> DatatypeInfo '[xs]
293301 -> POP Maybe '[xs]
294302 -> Series
303+#if MIN_VERSION_generics_sop(0,5,0)
304+sopSwaggerGenericToEncoding' opts (SOP (Z fields)) (ADT _ _ (Record _ fieldsInfo :* Nil) _) (POP (defs :* Nil)) =
305+#else
295306sopSwaggerGenericToEncoding' opts (SOP (Z fields)) (ADT _ _ (Record _ fieldsInfo :* Nil)) (POP (defs :* Nil)) =
307+#endif
296308 sopSwaggerGenericToEncoding'' opts fields fieldsInfo defs
297309sopSwaggerGenericToEncoding' _ _ _ _ = error "sopSwaggerGenericToEncoding: unsupported type"
298310
swagger2.cabal+1−1
@@ -77,7 +77,7 @@ library
7777 , aeson >=1.4.2.0 && <1.5
7878 -- cookie 0.4.3 is needed by GHC 7.8 due to time>=1.4 constraint
7979 , cookie >=0.4.3 && <0.5
80− , generics-sop >=0.3.2.0 && <0.5
80+ , generics-sop >=0.3.2.0 && <0.6
8181 , hashable >=1.2.7.0 && <1.3
8282 , http-media >=0.7.1.2 && <0.9
8383 , insert-ordered-containers >=0.2.1.0 && <0.3