on master help sign in
Canonicalize API before generating docs.
commitb23b3341288a349b40182b94e510cb415e2fb849 authorJulian K. Arni <jkarni@gmail.com> dateSun 19 Apr 2015, 14:35 (11 years ago) parentf90348c
2 files changed+5−4
CHANGELOG.md+1 src/Servant/Docs/Internal.hs+4−4
CHANGELOG.md+1
@@ -5,6 +5,7 @@
55* Render endpoints in a canonical order (https://github.com/haskell-servant/servant-docs/pull/15)
66* Remove ToJSON superclass from ToSample
77* Split out Internal module
8+* `Canonicalize` API types before generating the docs for them
89
9100.3
1011---
src/Servant/Docs/Internal.hs+4−4
@@ -273,8 +273,8 @@ makeLenses ''Action
273273
274274-- | Generate the docs for a given API that implements 'HasDocs'. This is the
275275-- default way to create documentation.
276−docs :: HasDocs layout => Proxy layout -> API
277−docs p = docsFor p (defEndpoint, defAction)
276+docs :: HasDocs (Canonicalize layout) => Proxy layout -> API
277+docs p = docsFor (canonicalize p) (defEndpoint, defAction)
278278
279279-- | Closed type family, check if endpoint is exactly within API.
280280
@@ -318,7 +318,7 @@ extraInfo p action =
318318-- 'extraInfo'.
319319--
320320-- If you only want to add an introduction, use 'docsWithIntros'.
321−docsWith :: HasDocs layout
321+docsWith :: HasDocs (Canonicalize layout)
322322 => [DocIntro]
323323 -> ExtraInfo layout
324324 -> Proxy layout
@@ -330,7 +330,7 @@ docsWith intros (ExtraInfo endpoints) p =
330330
331331-- | Generate the docs for a given API that implements 'HasDocs' with with any
332332-- number of introduction(s)
333−docsWithIntros :: HasDocs layout => [DocIntro] -> Proxy layout -> API
333+docsWithIntros :: HasDocs (Canonicalize layout) => [DocIntro] -> Proxy layout -> API
334334docsWithIntros intros = docsWith intros mempty
335335
336336-- | The class that abstracts away the impact of API combinators