git.iko.soy/typeable/servant
on master help sign in
Merge pull request #115 from haskell-servant/jkarni/patch-safe-link
c162e10Alp Mestanogullari
servant/CHANGELOG.md+4
@@ -1,3 +1,7 @@
1+0.4.2
2+-----
3+* Fix missing cases for `Patch` in `safeLink`
4+
10.4.1
50.4.1
2-----
6-----
3* Allow whitespace after parsing JSON
7* Allow whitespace after parsing JSON
servant/src/Servant/Utils/Links.hs+6
@@ -122,6 +122,7 @@ import Servant.API.Header ( Header )
122import Servant.API.Get ( Get )
122import Servant.API.Get ( Get )
123import Servant.API.Post ( Post )
123import Servant.API.Post ( Post )
124import Servant.API.Put ( Put )
124import Servant.API.Put ( Put )
125+import Servant.API.Patch ( Patch )
125import Servant.API.Delete ( Delete )
126import Servant.API.Delete ( Delete )
126import Servant.API.Sub ( type (:>) )
127import Servant.API.Sub ( type (:>) )
127import Servant.API.Raw ( Raw )
128import Servant.API.Raw ( Raw )
@@ -178,6 +179,7 @@ type family IsElem endpoint api :: Constraint where
178 IsElem (Get ct typ) (Get ct' typ) = IsSubList ct ct'
179 IsElem (Get ct typ) (Get ct' typ) = IsSubList ct ct'
179 IsElem (Post ct typ) (Post ct' typ) = IsSubList ct ct'
180 IsElem (Post ct typ) (Post ct' typ) = IsSubList ct ct'
180 IsElem (Put ct typ) (Put ct' typ) = IsSubList ct ct'
181 IsElem (Put ct typ) (Put ct' typ) = IsSubList ct ct'
182+ IsElem (Patch ct typ) (Patch ct' typ) = IsSubList ct ct'
181 IsElem (Delete ct typ) (Delete ct' typ) = IsSubList ct ct'
183 IsElem (Delete ct typ) (Delete ct' typ) = IsSubList ct ct'
182 IsElem e e = ()
184 IsElem e e = ()
183 IsElem e a = IsElem' e a
185 IsElem e a = IsElem' e a
@@ -352,6 +354,10 @@ instance HasLink (Put y r) where
352 type MkLink (Put y r) = URI
354 type MkLink (Put y r) = URI
353 toLink _ = linkURI
355 toLink _ = linkURI
354
356
357+instance HasLink (Patch y r) where
358+ type MkLink (Patch y r) = URI
359+ toLink _ = linkURI
360+
355instance HasLink (Delete y r) where
361instance HasLink (Delete y r) where
356 type MkLink (Delete y r) = URI
362 type MkLink (Delete y r) = URI
357 toLink _ = linkURI
363 toLink _ = linkURI