File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change
1
+ synopsis: Add NamedRoutes instance to IsElem
2
+ prs: #1699
3
+ issues: #1674
4
+ description: {
5
+ Add missing IsElem instance for NamedRoutes, this allows links to be checked
6
+ with `safeLink`.
7
+ }
Original file line number Diff line number Diff line change @@ -64,6 +64,10 @@ import Servant.API.QueryParam
64
64
(QueryFlag , QueryParam , QueryParams )
65
65
import Servant.API.ReqBody
66
66
(ReqBody )
67
+ import Servant.API.NamedRoutes
68
+ (NamedRoutes )
69
+ import Servant.API.Generic
70
+ (ToServantApi )
67
71
import Servant.API.Sub
68
72
(type (:> ))
69
73
import Servant.API.Verbs
@@ -142,6 +146,7 @@ type family IsElem endpoint api :: Constraint where
142
146
IsElem (Verb m s ct typ ) (Verb m s ct' typ )
143
147
= IsSubList ct ct'
144
148
IsElem e e = ()
149
+ IsElem e (NamedRoutes rs ) = IsElem e (ToServantApi rs )
145
150
IsElem e a = IsElem' e a
146
151
147
152
-- | Check whether @sub@ is a sub-API of @api@.
You can’t perform that action at this time.
0 commit comments