api_sketch 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +5 -1
- data/examples/api_project/resources/users.rb +4 -0
- data/lib/api_sketch/dsl/attributes.rb +1 -1
- data/lib/api_sketch/version.rb +1 -1
- data/lib/api_sketch.rb +1 -0
- data/spec/lib/api_sketch/dsl_spec.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59b23a950bd7f15bf9b8776f9cc9bf83b0f47ac6
|
4
|
+
data.tar.gz: e9efb9c5b336f7af4b2b1f85ee5f641ce322e9a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 975a604a21613ac94626a3308e4b026caa6abba794ffc83ad525f247ada1dcd1ca533e81055687334d4629be55be001121d711b22659aa2d2089693f2bb35f23
|
7
|
+
data.tar.gz: 2344e96d9c32bbf809ded5a125bb98b1b04ed192d30e7754af9d0f0287a91f2fc21ff01ae889a78cc59bf6f9529833731f62d39ce0f53c57ddb99253b9981164
|
data/CHANGELOG.md
CHANGED
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
|
@@ -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
|
data/lib/api_sketch/version.rb
CHANGED
data/lib/api_sketch.rb
CHANGED
@@ -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.
|
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:
|
11
|
+
date: 2016-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-cli
|