[erlang-questions] cowboy-swagger newbie question
Mark Geib
mark.geib.44@REDACTED
Thu Feb 11 22:25:08 CET 2016
I am trying to evaluate the cowboy-swagger library which runs on top of cowboy-trails. So far pretty interesting. However I need some help in how to provide the swagger metadata for an endpoint where I have a root url like /applicaiton/rest/file/[:op]/[arg1]/[arg2] that I want to provide documentation for. I assume that I want to use the swagger “basePath” and “paths” attributes but can’t seem to make that work. I have tried the following in all the forms I can image:
trails() ->
MsgTrailsMetadata =
#{basePath => “/application/rest/file/",
paths => [#{<<"/list">> =>
#{get => #{tags => ["file"],
description => “list available mpeg files",
produces => ["application/json"]
}}},
#{<<"/played">> =>
#{get => #{tags => ["file"],
description => “list played mpeg files",
produces => ["application/json"]}}}]
},
[trails:trail(“/application/rest/file/:op/[:arg1/[:arg2]]", ?MODULE, [], MsgTrailsMetadata)].
Any ideas are appreciated.
Mark.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160211/0084bff0/attachment.bin>
More information about the erlang-questions
mailing list