git.iko.soy/typeable/swagger2
on master help sign in
Merge pull request #189 from felixonmars/generics-sop-0.5
cf4b03bOleg Grenrus
src/Data/Swagger/Internal/AesonUtils.hs+12
@@ -144,7 +144,11 @@ sopSwaggerGenericToJSON'
144 -> DatatypeInfo '[xs]
144 -> DatatypeInfo '[xs]
145 -> POP Maybe '[xs]
145 -> POP Maybe '[xs]
146 -> [Pair]
146 -> [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
147sopSwaggerGenericToJSON' opts (SOP (Z fields)) (ADT _ _ (Record _ fieldsInfo :* Nil)) (POP (defs :* Nil)) =
150sopSwaggerGenericToJSON' opts (SOP (Z fields)) (ADT _ _ (Record _ fieldsInfo :* Nil)) (POP (defs :* Nil)) =
151+#endif
148 sopSwaggerGenericToJSON'' opts fields fieldsInfo defs
152 sopSwaggerGenericToJSON'' opts fields fieldsInfo defs
149sopSwaggerGenericToJSON' _ _ _ _ = error "sopSwaggerGenericToJSON: unsupported type"
153sopSwaggerGenericToJSON' _ _ _ _ = error "sopSwaggerGenericToJSON: unsupported type"
150
154
@@ -220,7 +224,11 @@ sopSwaggerGenericParseJSON'
220 -> DatatypeInfo '[xs]
224 -> DatatypeInfo '[xs]
221 -> POP Maybe '[xs]
225 -> POP Maybe '[xs]
222 -> Parser (SOP I '[xs])
226 -> 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
223sopSwaggerGenericParseJSON' opts obj (ADT _ _ (Record _ fieldsInfo :* Nil)) (POP (defs :* Nil)) =
230sopSwaggerGenericParseJSON' opts obj (ADT _ _ (Record _ fieldsInfo :* Nil)) (POP (defs :* Nil)) =
231+#endif
224 SOP . Z <$> sopSwaggerGenericParseJSON'' opts obj fieldsInfo defs
232 SOP . Z <$> sopSwaggerGenericParseJSON'' opts obj fieldsInfo defs
225sopSwaggerGenericParseJSON' _ _ _ _ = error "sopSwaggerGenericParseJSON: unsupported type"
233sopSwaggerGenericParseJSON' _ _ _ _ = error "sopSwaggerGenericParseJSON: unsupported type"
226
234
@@ -292,7 +300,11 @@ sopSwaggerGenericToEncoding'
292 -> DatatypeInfo '[xs]
300 -> DatatypeInfo '[xs]
293 -> POP Maybe '[xs]
301 -> POP Maybe '[xs]
294 -> Series
302 -> 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
295sopSwaggerGenericToEncoding' opts (SOP (Z fields)) (ADT _ _ (Record _ fieldsInfo :* Nil)) (POP (defs :* Nil)) =
306sopSwaggerGenericToEncoding' opts (SOP (Z fields)) (ADT _ _ (Record _ fieldsInfo :* Nil)) (POP (defs :* Nil)) =
307+#endif
296 sopSwaggerGenericToEncoding'' opts fields fieldsInfo defs
308 sopSwaggerGenericToEncoding'' opts fields fieldsInfo defs
297sopSwaggerGenericToEncoding' _ _ _ _ = error "sopSwaggerGenericToEncoding: unsupported type"
309sopSwaggerGenericToEncoding' _ _ _ _ = error "sopSwaggerGenericToEncoding: unsupported type"
298
310
swagger2.cabal+1−1
@@ -77,7 +77,7 @@ library
77 , aeson >=1.4.2.0 && <1.5
77 , aeson >=1.4.2.0 && <1.5
78 -- cookie 0.4.3 is needed by GHC 7.8 due to time>=1.4 constraint
78 -- cookie 0.4.3 is needed by GHC 7.8 due to time>=1.4 constraint
79 , cookie >=0.4.3 && <0.5
79 , cookie >=0.4.3 && <0.5
80− , generics-sop >=0.3.2.0 && <0.5
80+ , generics-sop >=0.3.2.0 && <0.6
81 , hashable >=1.2.7.0 && <1.3
81 , hashable >=1.2.7.0 && <1.3
82 , http-media >=0.7.1.2 && <0.9
82 , http-media >=0.7.1.2 && <0.9
83 , insert-ordered-containers >=0.2.1.0 && <0.3
83 , insert-ordered-containers >=0.2.1.0 && <0.3