From 8b0ade729e45e8f450d1fdd6237e025d389decab Mon Sep 17 00:00:00 2001 From: "Julian K. Arni" Date: Fri, 5 Jun 2015 12:18:01 +0200 Subject: [PATCH] Add missing Patch case for safeLink --- servant/CHANGELOG.md | 4 ++++ servant/src/Servant/Utils/Links.hs | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/servant/CHANGELOG.md b/servant/CHANGELOG.md index 21dd0278..a640d629 100644 --- a/servant/CHANGELOG.md +++ b/servant/CHANGELOG.md @@ -1,3 +1,7 @@ +0.4.2 +----- +* Fix missing cases for `Patch` in `safeLink` + 0.4.1 ----- * Allow whitespace after parsing JSON diff --git a/servant/src/Servant/Utils/Links.hs b/servant/src/Servant/Utils/Links.hs index a217e20d..8238e97f 100644 --- a/servant/src/Servant/Utils/Links.hs +++ b/servant/src/Servant/Utils/Links.hs @@ -122,6 +122,7 @@ import Servant.API.Header ( Header ) import Servant.API.Get ( Get ) import Servant.API.Post ( Post ) import Servant.API.Put ( Put ) +import Servant.API.Patch ( Patch ) import Servant.API.Delete ( Delete ) import Servant.API.Sub ( type (:>) ) import Servant.API.Raw ( Raw ) @@ -178,6 +179,7 @@ type family IsElem endpoint api :: Constraint where IsElem (Get ct typ) (Get ct' typ) = IsSubList ct ct' IsElem (Post ct typ) (Post ct' typ) = IsSubList ct ct' IsElem (Put ct typ) (Put ct' typ) = IsSubList ct ct' + IsElem (Patch ct typ) (Patch ct' typ) = IsSubList ct ct' IsElem (Delete ct typ) (Delete ct' typ) = IsSubList ct ct' IsElem e e = () IsElem e a = IsElem' e a @@ -352,6 +354,10 @@ instance HasLink (Put y r) where type MkLink (Put y r) = URI toLink _ = linkURI +instance HasLink (Patch y r) where + type MkLink (Patch y r) = URI + toLink _ = linkURI + instance HasLink (Delete y r) where type MkLink (Delete y r) = URI toLink _ = linkURI