servant-docs: Fix docsWith.

When adding extra info using using docsWith, the responses vanished from
the output. This was due to combineAction being left-biased, and
docsWith combining the extra info with the enpoint (in that
order). Flipping combineAction solves this.
This commit is contained in:
Philipp Kant 2015-06-16 10:53:13 +02:00
parent 56b91b1d77
commit 8dc6d9a7d4

View file

@ -338,7 +338,7 @@ extraInfo p action =
docsWith :: HasDocs layout => [DocIntro] -> ExtraInfo layout -> Proxy layout -> API docsWith :: HasDocs layout => [DocIntro] -> ExtraInfo layout -> Proxy layout -> API
docsWith intros (ExtraInfo endpoints) p = docsWith intros (ExtraInfo endpoints) p =
docs p & apiIntros <>~ intros docs p & apiIntros <>~ intros
& apiEndpoints %~ HM.unionWith combineAction endpoints & apiEndpoints %~ HM.unionWith (flip combineAction) endpoints
-- | Generate the docs for a given API that implements 'HasDocs' with with any -- | Generate the docs for a given API that implements 'HasDocs' with with any