api_sketch 0.1.5 → 0.1.6

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: 8e6352e10485a0dd6459be63fa12a04346b34098
4
- data.tar.gz: 37407cc18194ff48ad3144ce084241fe3690e55d
3
+ metadata.gz: 59b23a950bd7f15bf9b8776f9cc9bf83b0f47ac6
4
+ data.tar.gz: e9efb9c5b336f7af4b2b1f85ee5f641ce322e9a3
5
5
  SHA512:
6
- metadata.gz: f9a6db241e83a09c79c931298a8de9f0ac2252ac11243990f448fc88a161198c608f3f4d0ef76d2ed4a7cab0042b15cf86bc06b5b5844a03d68626f7ebe1e340
7
- data.tar.gz: 4ed5f29efcbc4cb6e9e963fc44eaeae94ba9ddd16e654e6eb833d4eb60b77f32b8cdf7aad9e713cb93f756f5d57dac9bbc17674b75c0af5f552ab0920531c2fe
6
+ metadata.gz: 975a604a21613ac94626a3308e4b026caa6abba794ffc83ad525f247ada1dcd1ca533e81055687334d4629be55be001121d711b22659aa2d2089693f2bb35f23
7
+ data.tar.gz: 2344e96d9c32bbf809ded5a125bb98b1b04ed192d30e7754af9d0f0287a91f2fc21ff01ae889a78cc59bf6f9529833731f62d39ce0f53c57ddb99253b9981164
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.1.6 / 2016-09-11
2
+ - Add multipart field (file)
3
+
1
4
  # 0.1.5 / 2015-06-23
2
5
  - Add links to index page.
3
6
  - Add sample_call keyword for CURL examples
data/README.md CHANGED
@@ -133,7 +133,7 @@ If `namespace` is omitted than it would be derived from folders structure and fi
133
133
 
134
134
  DSL provides `path`, `http_method`, `headers`, `parameters` keywords for request data definition. Parameters could be placed at `query` and `body` containers. Both of them could have `:array` or `:document` structure.
135
135
 
136
- Supported attribute types are: `integer`, `string`, `float`, `boolean`, `datetime`, `timestamp`, `document`, `array`
136
+ Supported attribute types are: `integer`, `string`, `float`, `boolean`, `datetime`, `timestamp`, `document`, `array`, `file`
137
137
 
138
138
  Each attribute should have name, could have `description`, `example` value, could be `required`.
139
139
 
@@ -216,6 +216,10 @@ resource "Update user profile" do # Resource name
216
216
  example { Time.now.to_i }
217
217
  end
218
218
 
219
+ file "avatar" do
220
+ description "Avatar file"
221
+ end
222
+
219
223
  array "place_ids" do
220
224
  description "user's places ids"
221
225
  required false
@@ -64,6 +64,10 @@ resource "Update user profile" do
64
64
  example { Time.now.to_i }
65
65
  end
66
66
 
67
+ file "avatar" do
68
+ description "Avatar file"
69
+ end
70
+
67
71
  array "place_ids" do
68
72
  description "user's places ids"
69
73
  required false
@@ -1,6 +1,6 @@
1
1
  class ApiSketch::DSL::Attributes < ApiSketch::DSL::Base
2
2
 
3
- TYPES = [:integer, :string, :float, :boolean, :datetime, :timestamp, :document, :array]
3
+ TYPES = [:integer, :string, :float, :boolean, :datetime, :timestamp, :document, :array, :file]
4
4
 
5
5
  def initialize(container_type, &block)
6
6
  @container_type = container_type
@@ -1,3 +1,3 @@
1
1
  module ApiSketch
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
data/lib/api_sketch.rb CHANGED
@@ -31,6 +31,7 @@ module ApiSketch
31
31
  require "api_sketch/helpers"
32
32
  require "api_sketch/config"
33
33
  require "api_sketch/response_renderer"
34
+ require "api_sketch/curl_renderer"
34
35
  require "api_sketch/examples_server"
35
36
  require "api_sketch/runner"
36
37
  end
@@ -308,6 +308,10 @@ describe ApiSketch::DSL do
308
308
  end
309
309
  end
310
310
  end
311
+
312
+ file "avatar" do
313
+ description "Avatar file"
314
+ end
311
315
  end
312
316
  end
313
317
  end
@@ -436,6 +440,10 @@ describe ApiSketch::DSL do
436
440
  expect(document_content[1].data_type).to eql :document
437
441
  expect(document_content[1].name).to eql "stats"
438
442
 
443
+ expect(document_content[2].name).to eql "avatar"
444
+ expect(document_content[2].data_type).to eql :file
445
+ expect(document_content[2].description).to eql "Avatar file"
446
+
439
447
  inner_content = document_content[1].content
440
448
  expect(inner_content[0].name).to eql "login_at"
441
449
  expect(inner_content[0].data_type).to eql :timestamp
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_sketch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Suhoviy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-22 00:00:00.000000000 Z
11
+ date: 2016-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-cli