ddy_swagger_docs 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1815b6fd03de010214351fd8b2ea9b4995e121e8
4
- data.tar.gz: ae6bc89ef78a196cf1d157b14fecdeb77a832aa2
3
+ metadata.gz: 1bdc4cec491182bd2111b78c2117b0ba55dd13c8
4
+ data.tar.gz: 20b2fd13676a93bd770e8027adaa6028da507440
5
5
  SHA512:
6
- metadata.gz: a09ef9dbdbacdc2a6980a27737eec13f34175861025dccd0f656fc8fd3e159c36a0836cae0aef4fa876c98378ac84e8bda84d4998e43fc966f6a6de9f22a4e25
7
- data.tar.gz: 2044cccf2ad2f660df361e5676687ec6060536f0f99a5287ab64ba04f3fa9c7dde3754cb922f4b187694e0e51cc63d5f12965e063e6b0c9d7cd2065fdbc0b817
6
+ metadata.gz: d09ccbfecbdf4e229eb35989376ed6f1223924e8d6a1cfd9d83020904585fb2a557df68725e20a20ded955f80933dabcb1b87cb213fc6a3502566c1c4fbf720a
7
+ data.tar.gz: 7b4ca6ee41e4f4e0413a69097c1ea9bf17668c81d63c5e491bf1b1ead0cef3600923609e4161dbc7eff56b29d6e329912dc08e5df0dc6ac517c1bb8596ca3caa
@@ -1,3 +1,3 @@
1
1
  module SwaggerDocs
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
@@ -2651,7 +2651,7 @@ SwaggerOperation.prototype.encodePathParam = function (pathParam) {
2651
2651
  };
2652
2652
 
2653
2653
  SwaggerOperation.prototype.urlify = function (args) {
2654
- var i, j, param, url;
2654
+ var i, j, param, url, paramValues, paramSeparator, paramAdded;
2655
2655
  // ensure no double slashing...
2656
2656
  if(this.resource.basePath.length > 1 && this.resource.basePath.slice(-1) === '/' && this.pathJson().charAt(0) === '/')
2657
2657
  url = this.resource.basePath + this.pathJson().substring(1);
@@ -2689,7 +2689,27 @@ SwaggerOperation.prototype.urlify = function (args) {
2689
2689
  }
2690
2690
  else {
2691
2691
  if (typeof args[param.name] !== 'undefined') {
2692
- queryParams += encodeURIComponent(param.name) + '=' + encodeURIComponent(args[param.name]);
2692
+ paramAdded = false;
2693
+
2694
+ if(typeof param.collectionFormat !== 'undefined' && param.signature === 'array[string]') {
2695
+ paramSeparator = '';
2696
+ if (param.collectionFormat === 'multi' || param.collectionFormat === 'csv') {
2697
+ paramSeparator = ','
2698
+ }
2699
+ if ('' !== paramSeparator) {
2700
+ paramAdded = true;
2701
+ paramValues = args[param.name].split(paramSeparator);
2702
+ for (j = 0; j < paramValues.length; j++) {
2703
+ if (j !== 0)
2704
+ queryParams += '&';
2705
+ queryParams += encodeURIComponent(param.name) + '[]=' + encodeURIComponent(paramValues[j]);
2706
+ }
2707
+ }
2708
+ }
2709
+
2710
+ if (!paramAdded) {
2711
+ queryParams += encodeURIComponent(param.name) + '=' + encodeURIComponent(args[param.name]);
2712
+ }
2693
2713
  } else {
2694
2714
  if (param.required)
2695
2715
  throw '' + param.name + ' is a required query param.';
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddy_swagger_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan van der Pas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-26 00:00:00.000000000 Z
11
+ date: 2016-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler