I am using Servant.OpenApi.toOpenApi
to generate an OpenApi (i.e, “Swagger”) description. In the example that follows, the api
variable holds the generated description.
I have figured out how to use operationsOf
to add a description to a route of the generated OpenApi description via:
let sub2 = (mempty :: OpenApi) & paths .~
IOHM.fromList [("/vcp/createSignerData/{numMsgs}", mempty & post ?~ mempty)]
putStrLn "SUB2"
putLBSLn $ A.encode $ api & operationsOf sub2 . description ?~ "SUB2 FOO--------------"
But I can’t figure out how to add descriptions to path and/or query parameters (e.g., numMsgs
in this example) for that route.