How to get Swagger API JS function names?
<p>I'm new to <a href="http://developer.wordnik.com/docs.html" rel="nofollow noreferrer">Wordnik</a> and <a href="http://swagger.io/" rel="nofollow noreferrer">Swagger</a> in general. I'm interacting with it through the <a href="https://github.com/swagger-api/swagger-js" rel="nofollow noreferrer">Node.js JS module</a>.</p>

<p>When looking at the generated Swagger UI pages, such as the sample <a href="http://petstore.swagger.io/#/" rel="nofollow noreferrer">Petstore Swagger</a> one:</p>

<p><a href="https://i.stack.imgur.com/P11Xg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/P11Xg.png" alt="enter image description here"></a></p>

<p>it is difficult to tell what the JavaScript functions should be when querying the server.</p>

<p>By JavaScript functions, I mean similar to the Petstore sample example (from the swagger-js docs):</p>

<pre><code>var Swagger = require('swagger-client');

var client = new Swagger({
  url: 'http://petstore.swagger.io/v2/swagger.json',
  success: function() {
    client.pet.getPetById({petId:7},{responseContentType: 'application/json'},function(pet){
      console.log('pet', pet);
    });
  }
});
</code></pre>

<p>After connecting to <code>swagger.json</code>, how do they know the function to query the <code>getPetById()</code> function when the docs only show <code>GET /pet/{petId}</code>?</p>

<p>When using the Wordnik API, I've found it a general rule of thumb to use the <code>get{DATATYPE}()</code> function (with <code>{DATATYPE}</code> replaced with an appropriate value, of course), but the pattern has broken with <code>getPronunciation()</code> &mdash; it doesn't work. I don't believe the docs say it anywhere.</p>

<p>How could I find the JS functions for Swagger APIs?</p>