<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Thanks for the reply. <div class=""><br class=""></div><div class="">However, I am a bit confused as to how I document the different operations then. I need to be able to provide metadata for more than one GET, one for “list” and and one for “played”. The parameters, for example, are different for each operation.<div class=""><br class=""></div><div class="">BTW, I am new to RESTful endpoints, so it could be a poor choice for an example.</div><div class=""><div class=""><br class=""></div><div class="">Mark.</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 11, 2016, at 2:44 PM, Brujo Benavides <<a href="mailto:fernando.benavides@inakanetworks.com" class="">fernando.benavides@inakanetworks.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><p dir="ltr" class="">Hi Mark,</p><p dir="ltr" class="">This email will be very brief (read: mostly useless :P) because I am on vacation and I can't actually try your example from here :(<br class="">
Surely someone from inaka (Harry, Carlos, I am looking at you guys) will give you a better answer soon.<br class="">
In any case, the problem with your example seems to be that you are trying to provide the whole swagger metadata when just the metadata for the current endpoint is needed.<br class="">
In other words, you don't have to provide the basepath (that comes from trails:root_path(), or similar function) and 'paths' is automatically generated by cowboy-swagger. You just need to provide the metadata (including the parameters, specifically those in your path) for your endpoints. <br class="">
Hope this helps. </p>
<div class="gmail_quote">On Feb 11, 2016 7:25 PM, "Mark Geib" <<a href="mailto:mark.geib.44@gmail.com" class="">mark.geib.44@gmail.com</a>> wrote:<br type="attribution" class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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:<br class="">
<br class="">
trails() -><br class="">
  MsgTrailsMetadata =<br class="">
          #{basePath => “/application/rest/file/",<br class="">
                paths => [#{<<"/list">> =><br class="">
                                   #{get => #{tags => ["file"],<br class="">
                                                        description => “list available mpeg files",<br class="">
                                                        produces => ["application/json"]<br class="">
                                                   }}},<br class="">
                                  #{<<"/played">> =><br class="">
                                   #{get => #{tags => ["file"],<br class="">
                                                        description => “list played mpeg files",<br class="">
                                                        produces => ["application/json"]}}}]<br class="">
<br class="">
     },<br class="">
  [trails:trail(“/application/rest/file/:op/[:arg1/[:arg2]]", ?MODULE, [], MsgTrailsMetadata)].<br class="">
<br class="">
Any ideas are appreciated.<br class="">
<br class="">
Mark.<br class="">
<br class="">
<br class="">_______________________________________________<br class="">
erlang-questions mailing list<br class="">
<a href="mailto:erlang-questions@erlang.org" class="">erlang-questions@erlang.org</a><br class="">
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank" class="">http://erlang.org/mailman/listinfo/erlang-questions</a><br class="">
<br class=""></blockquote></div>
</div></blockquote></div><br class=""></div></div></div></body></html>