Permalink
Browse files

Not sending parameters with no set value unless they are marked as

required.
  • Loading branch information...
1 parent 6964c17 commit 3424a740f503ccf8c13f10966d3d0fde58223dec @gkostov gkostov committed Jul 23, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 public/javascripts/docs.js
@@ -176,6 +176,13 @@
apiName = { name: 'apiName', value: $('input[name=apiName]').val() },
apiUsername = { name: 'apiUsername', value: $('input[name=username]').val() },
apiPassword = { name: 'apiPassword', value: $('input[name=password]').val() };
+
+ for(var i=0; i<params.length; i++){
+ var paramEl=$('.parameters [name="'+params[i].name+'"]', this);
+ if(params[i].value==='' && paramEl.length && !paramEl.is('[placeholder=required]')){
+ params.splice(i--, 1); // remove params with no set value if they are not marked as required
+ }
+ }
params.push(apiKey, apiSecret, apiName, apiUsername, apiPassword);

0 comments on commit 3424a74

Please sign in to comment.