on master help sign in
Long docs
commit766bae04ba62169cf6bb6ba2f6efa7bffc030d67 authoriko <ilyakooo0@gmail.com> dateFri 3 May 2019, 00:28 (7 years ago) parentc7eb007
2 files changed+10−6
denis/docs/Docs.hs+6−4 denis/src/Data/Message.hs+4−2
denis/docs/Docs.hs+6−4
@@ -26,16 +26,18 @@ import Servant.Server.Experimental.Auth
2626import Network.Wai
2727import Server.API.Messages
2828
29+docsWriterLong :: HasDocs api => String -> Proxy api -> IO ()
30+docsWriterLong file = writeFile ("docs/" ++ file ++ ".md") . normalizer . markdown . flip docsWithOptions (DocOptions 15)
2931docsWriter :: HasDocs api => String -> Proxy api -> IO ()
3032docsWriter file = writeFile ("docs/" ++ file ++ ".md") . normalizer . markdown . docs
3133
3234main = do
33− docsWriter "posts" $ pretty (Proxy :: Proxy ("posts" :> PostApi))
34− docsWriter "messages" $ pretty (Proxy :: Proxy (MessagesApi))
35+ docsWriterLong "posts" $ pretty (Proxy :: Proxy ("posts" :> PostApi))
36+ docsWriterLong "messages" $ pretty (Proxy :: Proxy (MessagesApi))
3537 docsWriter "all" $ pretty serverProxy
36− docsWriter "authentication" $ pretty (Proxy :: Proxy ("authentication" :> AuthenticationHandler :<|>
38+ docsWriterLong "authentication" $ pretty (Proxy :: Proxy ("authentication" :> AuthenticationHandler :<|>
3739 Authentication :> "authentication" :> "me" :> Post '[JSON] UserId ))
38− docsWriter "channels" $ pretty (Proxy :: Proxy ("channels" :> ChannelsApi))
40+ docsWriterLong "channels" $ pretty (Proxy :: Proxy ("channels" :> ChannelsApi))
3941 T.writeFile ("docs/Home.md") . (\t -> "```\n" <> t <> "```\n") $ layoutWithContext serverProxy (undefined :: Context (AuthHandler Request UserId ': '[]))
4042
4143
denis/src/Data/Message.hs+4−2
@@ -110,8 +110,10 @@ storeMessage (Message mId aId dId pb mt) = case dId of
110110 UserChatDestination uId -> MessageStorage mId aId Nothing (Just uId) (Jsonb pb) mt
111111
112112instance ToSample MessageCreation where
113− toSamples _ = samples $ MessageCreation Nothing (Just 69) <$>
114− map (Jsonb . snd) (toSamples Proxy)
113+ toSamples _ = samples $ (MessageCreation Nothing (Just 69) <$>
114+ map (Jsonb . snd) (toSamples Proxy)) <>
115+ (MessageCreation (Just 5) Nothing <$>
116+ map (Jsonb . snd) (toSamples Proxy))
115117
116118data MessageCreation = MessageCreation {
117119 messageCreationDestinationGroupId :: Maybe GroupChatId,