title: Making calls from the Javascript client library with @Named and unnamed parameters makes no sense
body: <p>I have a <code>Cloud Endpoints</code> method that looks like this:</p>
  
  <pre><code>//HTTP POST
  @ApiMethod(name = "hylyts.insert")
  public Hylyt insertHylyt(@Named("url") String url, Hylyt hylyt, User user)
          throws OAuthRequestException{
      log.info("Trying to save hylyt '"+hylyt+"' with id '"+hylyt.getId());
      if (user== null) throw new OAuthRequestException("Your token is no good here.");
      hylyt.setArticle(getArticleKey(url, user));
      ofy().save().entity(hylyt);
      return hylyt;
  }
  </code></pre>
  
  <p>I call it from the <code>Javascript Client Library</code> using this:</p>
  
  <pre><code>gapi.client.hylytit.hylyts.insert({PARAMS}).execute(callback);
  </code></pre>
  
  <p>Now, if I structure <code>{PARAMS}</code> as suggested in the <a href="https://developers.google.com/api-client-library/javascript/dev/dev_jscript#ExampleGoogleCloudStorage" rel="nofollow noreferrer">docs</a> (second example),</p>
  
  <pre><code>{
    'url': url,
    'resource': {
      'hylyt': {
        'contentType': 'application/json',
        'data': hylyt
      }
    }
  }
  </code></pre>
  
  <p>I get a null object in the endpoint (not to mention that the whole point of this library is to make these calls simple, which this structure clearly violates). </p>
  
  <p>When I structure <code>{PARAMS}</code> as <a href="https://stackoverflow.com/a/17458007/1720014">these</a> <a href="https://stackoverflow.com/questions/19804951/google-cloud-endpoints-making-calls-with-js-client-passing-params-and-json-bo/19809245#19809245">answers</a> suggest,</p>
  
  <pre><code>{
    'url': url,
    'resource': hylyt
  }
  </code></pre>
  
  <p>I get a null object in the endpoint again. The correct syntax is this:</p>
  
  <pre><code>{
    'url': url,
    'id': hylyt.id
    'text': hylyt.text
  }
  </code></pre>
  
  <p>Which just blows my mind. Am I doing this all wrong? Is this a bug? Is it only happening because <code>gapi</code> is also passing the <code>auth token</code> in the background?</p>
  
  <p>Yes, I could use the <code>request</code> syntax instead, but, again, why even use the library if it's just as complex as making the <code>XHR</code>s in pure javascript? I wouldn't mind the complexity if Google explained in the docs <em>why</em> things are happening. But the docs, paraphrased, just say use these methods and the auth, CORS, and XHR magic will happen behind closed doors. </p>