|=      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None&'(023468=EJKM&WA datatype that represents everything that can happen at an endpoint, with its lenses:List of captures (c)List of GET parameters (g)=What the request body should look like, if any is requested (i)5What the response should be if everything goes well (h)You can tweak an  (like the default :K) with these lenses to transform an action and add some information to it. -A type to represent an HTTP response. Has an  status, a list of possible  MediaTypes, and a list of example  response bodies. Tweak 8 using the S, T and Q lenses if you want.[If you want to respond with a non-empty response body, you'll most likely want to write a ]O instance for the type that'll be represented as encoded data in the response.!Can be tweaked with three lenses. (> defResponse Response {_respStatus = 200, _respTypes = [], _respBody = []} > defResponse & respStatus .~ 204 & respBody .~ [("If everything goes well", "{ \"status\": \"ok\" }")] Response {_respStatus = 204, _respTypes = [], _respBody = [("If everything goes well", "{ \"status\": \"ok\" }")]}Type of GET parameter:Normal corresponds to  QueryParam, i.e your usual GET parameterList corresponds to  QueryParams), i.e GET parameters with multiple valuesFlag corresponds to  QueryFlag , i.e a value-less GET parameterTType of extra information that a user may wish to "union" with their documentation.mThese are intended to be built using extraInfo. Multiple ExtraInfo may be combined with the monoid instance.;A type to represent extra notes that may be attached to an .|This is intended to be used when writing your own HasDocs instances to add extra sections to your endpoint's documentation.IAn introductory paragraph for your documentation. You can pass these to n.Appears above the intro blobEach String is a paragraph.A type to represent a GET parameter from the Query String. Holds its name, the possible values (leave empty if there isn't a finite number of them), and a description of how it influences the output or behavior.Write a W& instance for your GET parameter types$QA type to represent captures. Holds the name of the capture and a description.Write a U" instance for your captured types.(\Our API documentation type, a product of top-level information and a good old hashmap from , to ,An , type that holds the F and the E.Gets used as the key in the ( hashmap. Modify 6 or any , value you want using the F and E lenses to tweak. > 6 GET / > 6 & F  ["foo"] GET /foo > 6 & F  ["foo"] & E  2 POST /foo 0Supported HTTP request methods1the PUT method2the POST method3the GET method4the DELETE method5Render a path as a -delimited string6An ,) whose path is `"/"` and whose method is 3Here's how you can modify it: > 6 GET / > 6 & F  ["foo"] GET /foo > 6 & F  ["foo"] & E  2 POST /foo 7 An empty (84Default response: status code 200, no response body.Can be tweaked with two lenses. > defResponse Response {_respStatus = 200, _respBody = Nothing} > defResponse & respStatus .~ 204 & respBody .~ Just "[]" Response {_respStatus = 204, _respBody = Just "[]"}9QCombine two Actions, we can't make a monoid as merging Response breaks the laws.BAs such, we invent a non-commutative, left associative operation 9V to mush two together taking the response, body and content types from the very left.;8Create an API that's comprised of a single endpoint. ( is a (, so combine multiple endpoints with  or .ULThe class that helps us automatically get documentation for URL captures.Example of an instance: ninstance ToCapture (Capture "name" Text) where toCapture _ = DocCapture "name" "name of the person to greet"WNThe class that helps us automatically get documentation for GET parameters.Example of an instance: instance ToParam (QueryParam "capital" Bool) where toParam _ = DocQueryParam "capital" ["true", "false"] "Get the greeting message in uppercase (true) or not (false). Default is false."YGenerate a list of  MediaTypeC values describing the content types accepted by an API component.]The class that lets us display a sample input or output in the supported content-types when generating documentation for endpoints that either:expect a request body, or return a non empty response bodyExample of an instance: L{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} import Data.Aeson import Data.Text import GHC.Generics data Greet = Greet { _msg :: Text } deriving (Generic, Show) instance FromJSON Greet instance ToJSON Greet instance ToSample Greet Greet where toSample _ = Just g where g = Greet "Hello, haskeller!"*You can also instantiate this class using _ instead of ^G: it lets you specify different responses along with some context (as H) that explains when you're supposed to get the corresponding response.`[The class that abstracts away the impact of API combinators on documentation generation.b<Closed type family, check if endpoint is exactly within API.k2Generate the docs for a given API that implements `3. This is the default way to create documentation.l Create an 5 that is garunteed to be within the given API layout.yThe safety here is to ensure that you only add custom documentation to an endpoint that actually exists within your API. hextra :: ExtraInfo TestApi extra = extraInfo (Proxy :: Proxy ("greet" :> Capture "greetid" Text :> Delete)) $ defAction & headers <>~ ["unicorns"] & notes <>~ [ DocNote "Title" ["This is some text"] , DocNote "Second secton" ["And some more"] ]mGGenerate documentation given some extra introductions (in the form of DocInfo9) and some extra endpoint documentation (in the form of .The extra introductions will be prepended to the top of the documentation, before the specific endpoint documentation. The extra endpoint documentation will be "unioned" with the automatically generated endpoint documentation.IYou are expected to build up the ExtraInfo with the Monoid instance and l.-If you only want to add an introduction, use n.n2Generate the docs for a given API that implements `) with with any number of introduction(s)oJSynthesise a sample value of a type, encoded in the specified media types.p_Synthesise a list of sample values of a particular type, encoded in the specified media types.q;Generate documentation in Markdown format for the given (. "books" :>  "isbn" Text will appear as books:isbn in the docs.The generated docs for a  b just appends the docs for a with the docs for b.  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~k  !"#$%&'()*+,-./0123456789:;CDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopq04321BA,-./@56?()*+>7$%&' !"#=< 8 9:;DCFEHGLKJINMPOTSRQjihgfedckblmn`a]^_[\opYZWXUVq~}|{zyxwvutsrZ    !"#$%&'()*+,-./0432156789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~NoneS  !"#$%&'(,01234678:;CDEFGHIJKLMNOPQSTUVWX]^_`acdfghijklmnopqS`akqmnl]^_opWXUV04321,FE6(DC7$%&'HG !"#KLIJPONM STQ8cdfgjih:;       !!"#$$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~servant-docs-0.4.4Servant.Docs.Internal Servant.DocsAction _captures_headers_params_notes _mxParams_rqtypes_rqbody _responseResponse _respStatus _respTypes _respBody _respHeaders ParamKindFlagListNormal ExtraInfoDocNote _noteTitle _noteBodyDocIntro _introTitle _introBody DocQueryParam _paramName _paramValues _paramDesc _paramKind DocCapture _capSymbol_capDescAPI _apiIntros _apiEndpointsEndpoint_path_methodMethodDocPUTDocPOSTDocGET DocDELETEshowPath defEndpointemptyAPI defResponse combineAction defActionsingle$fMonoidExtraInfo $fOrdDocIntro $fMonoidAPI$fHashableEndpoint$fShowEndpoint$fHashableMethod $fShowMethod apiEndpoints apiIntrosmethodpathcapDesc capSymbol paramDesc paramKind paramName paramValues introBody introTitlenoteBody noteTitlerespBody respHeaders respStatus respTypes ToCapture toCaptureToParamtoParamSupportedTypessupportedTypesAllHeaderSamplesallHeaderToSampleToSampletoSample toSamplesHasDocsdocsForIsIncapturesheadersmxParamsnotesparamsresponserqbodyrqtypesdocs extraInfodocsWithdocsWithIntrossampleByteStringsampleByteStringsmarkdown $fHasDocs*:> $fHasDocs*:>0 $fHasDocs*Raw $fHasDocs*:>1 $fHasDocs*:>2 $fHasDocs*:>3 $fHasDocs*:>4 $fHasDocs*:>5 $fHasDocs*:>6 $fHasDocs*Put$fHasDocs*Put0$fHasDocs*Post$fHasDocs*Post0 $fHasDocs*:>7 $fHasDocs*Get$fHasDocs*Get0$fHasDocs*Delete$fHasDocs*Delete0 $fHasDocs*:>8$fHasDocs*:<|>$fSupportedTypes:$fSupportedTypes[]$fAllHeaderSamples[]:$fAllHeaderSamples[][]$fToSample*Headersbghc-prim GHC.TypesIntbytestring-0.10.4.0Data.ByteString.Lazy.Internal ByteString lens-4.12.2Control.Lens.Setter<>~.~baseGHC.Real/ Data.MonoidMonoidmappend<> text-1.2.1.2Data.Text.InternalText servant-0.4.4Servant.API.CaptureCaptureServant.API.Alternative:<|>