doc_smoosher 0.0.2 → 0.1.0

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: 8f88819f03578660903966d440c44ed336af08ad
4
- data.tar.gz: 64cae57da6df61b314a7b3f120c39e9850f53599
3
+ metadata.gz: bcad1868c37bd0e77fc6bc6d2ac7011a9c439dae
4
+ data.tar.gz: a1a94eaa5250848f8061986df9c83312d33ad90c
5
5
  SHA512:
6
- metadata.gz: b33b606df65bdb52391cfb4d784c7b1fa7d9c66d5c1cef359abb79a2e5e06edce36a8fa3cecf60afa103a3ef7c1c4b348f70e4b4a9d928cf02a0679331a0dc0b
7
- data.tar.gz: 43d2f407d9daa6c3fff0a05c3f7354936d54dd415d7e46fd132c613278a637e3ba3fe80f626ef6a971f90ad2d9e1055a61cba8edefbeefe9660ceba999954484
6
+ metadata.gz: 0e6a0bb9316c077d3f594562f54578d7dc423b7436f7c91471323428874e71d171948bcb2550845c4653349403b3e7e1c59d6159718ccee8ddaa21fd51ef4fbd
7
+ data.tar.gz: e5528a28c6b1063bdaeebd4b3795df93ad5dbb02d420c7226b257f8564083a440ef300c846d9ac3135c6b749a7f3a09612362f769382ac6563b4e63452bdb655
@@ -1,9 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- doc_smoosher (0.0.1)
5
- active_support
6
- i18n (~> 0)
4
+ doc_smoosher (0.1.0)
5
+ activesupport
7
6
  rake (~> 0)
8
7
  rest-client (~> 0)
9
8
  thor (~> 0)
@@ -11,8 +10,6 @@ PATH
11
10
  GEM
12
11
  remote: https://rubygems.org/
13
12
  specs:
14
- active_support (3.0.0)
15
- activesupport (= 3.0.0)
16
13
  activesupport (3.0.0)
17
14
  addressable (2.3.5)
18
15
  builder (3.2.2)
@@ -49,7 +46,6 @@ GEM
49
46
  rspec (>= 2.14, < 4.0)
50
47
  hashie (2.0.5)
51
48
  highline (1.6.20)
52
- i18n (0.6.9)
53
49
  jeweler (2.0.1)
54
50
  builder
55
51
  bundler (>= 1.0)
@@ -0,0 +1,9 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard :rspec do
5
+ watch(%r{^spec/.+_spec\.rb$})
6
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
7
+ watch('spec/spec_helper.rb') { "spec" }
8
+ end
9
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.1.0
@@ -0,0 +1,131 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+ # stub: doc_smoosher 0.1.0 ruby lib
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "doc_smoosher"
9
+ s.version = "0.1.0"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
13
+ s.authors = ["Joran Kikke"]
14
+ s.date = "2014-02-25"
15
+ s.description = " A simple API documentation generator for the complicated world we live in "
16
+ s.email = "joran.k@gmail.com"
17
+ s.executables = ["smoosher"]
18
+ s.extra_rdoc_files = [
19
+ "LICENSE.txt",
20
+ "README.md"
21
+ ]
22
+ s.files = [
23
+ ".document",
24
+ ".ruby-gemset",
25
+ ".ruby-version",
26
+ ".travis.yml",
27
+ "Gemfile",
28
+ "Gemfile.lock",
29
+ "Guardfile",
30
+ "LICENSE.txt",
31
+ "README.md",
32
+ "Rakefile",
33
+ "VERSION",
34
+ "bin/smoosher",
35
+ "doc_smoosher.gemspec",
36
+ "examples/ingenia/ingenia.rb",
37
+ "examples/ingenia/ingenia_webapp.rb",
38
+ "examples/ingenia/output/html/bootstrap.min.css",
39
+ "examples/ingenia/output/html/ingenia.html",
40
+ "examples/ingenia/output/html/prettify.css",
41
+ "examples/ingenia/output/html/prettify.js",
42
+ "examples/ingenia/output/html/run_prettify.js",
43
+ "lib/doc_smoosher.rb",
44
+ "lib/doc_smoosher/api.rb",
45
+ "lib/doc_smoosher/api_object.rb",
46
+ "lib/doc_smoosher/example.rb",
47
+ "lib/doc_smoosher/field.rb",
48
+ "lib/doc_smoosher/parameter.rb",
49
+ "lib/doc_smoosher/parameters.rb",
50
+ "lib/doc_smoosher/request.rb",
51
+ "lib/doc_smoosher/resource.rb",
52
+ "lib/doc_smoosher/response.rb",
53
+ "lib/load_doc_smoosher.rb",
54
+ "spec/lib/api_spec.rb",
55
+ "spec/lib/doc_smoosher_spec.rb",
56
+ "spec/spec_helper.rb",
57
+ "templates/Readme.md",
58
+ "templates/api.tt",
59
+ "templates/html/api.html.erb",
60
+ "templates/html/bootstrap.min.css",
61
+ "templates/html/prettify.css",
62
+ "templates/html/prettify.js",
63
+ "templates/html/run_prettify.js",
64
+ "templates/parameter.tt",
65
+ "templates/request.tt",
66
+ "templates/resource.tt",
67
+ "test/test.rb"
68
+ ]
69
+ s.homepage = "http://github.com/dangerousbeans/doc_smoosher"
70
+ s.licenses = ["MIT"]
71
+ s.rubygems_version = "2.2.2"
72
+ s.summary = "A simple API documentation generator for the complicated world we live in"
73
+
74
+ if s.respond_to? :specification_version then
75
+ s.specification_version = 4
76
+
77
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
78
+ s.add_runtime_dependency(%q<rake>, ["~> 0"])
79
+ s.add_runtime_dependency(%q<rest-client>, ["~> 0"])
80
+ s.add_runtime_dependency(%q<thor>, ["~> 0"])
81
+ s.add_runtime_dependency(%q<activesupport>, [">= 0"])
82
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
83
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
84
+ s.add_development_dependency(%q<bundler>, ["~> 1.0"])
85
+ s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
86
+ s.add_development_dependency(%q<simplecov>, [">= 0"])
87
+ s.add_development_dependency(%q<terminal-notifier>, [">= 0"])
88
+ s.add_development_dependency(%q<terminal-notifier-guard>, [">= 0"])
89
+ s.add_development_dependency(%q<guard-rspec>, [">= 0"])
90
+ s.add_development_dependency(%q<guard>, [">= 0"])
91
+ s.add_development_dependency(%q<doc_smoosher>, [">= 0"])
92
+ s.add_development_dependency(%q<sinatra>, [">= 0"])
93
+ s.add_development_dependency(%q<rspec>, [">= 0"])
94
+ else
95
+ s.add_dependency(%q<rake>, ["~> 0"])
96
+ s.add_dependency(%q<rest-client>, ["~> 0"])
97
+ s.add_dependency(%q<thor>, ["~> 0"])
98
+ s.add_dependency(%q<activesupport>, [">= 0"])
99
+ s.add_dependency(%q<shoulda>, [">= 0"])
100
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
101
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
102
+ s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
103
+ s.add_dependency(%q<simplecov>, [">= 0"])
104
+ s.add_dependency(%q<terminal-notifier>, [">= 0"])
105
+ s.add_dependency(%q<terminal-notifier-guard>, [">= 0"])
106
+ s.add_dependency(%q<guard-rspec>, [">= 0"])
107
+ s.add_dependency(%q<guard>, [">= 0"])
108
+ s.add_dependency(%q<doc_smoosher>, [">= 0"])
109
+ s.add_dependency(%q<sinatra>, [">= 0"])
110
+ s.add_dependency(%q<rspec>, [">= 0"])
111
+ end
112
+ else
113
+ s.add_dependency(%q<rake>, ["~> 0"])
114
+ s.add_dependency(%q<rest-client>, ["~> 0"])
115
+ s.add_dependency(%q<thor>, ["~> 0"])
116
+ s.add_dependency(%q<activesupport>, [">= 0"])
117
+ s.add_dependency(%q<shoulda>, [">= 0"])
118
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
119
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
120
+ s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
121
+ s.add_dependency(%q<simplecov>, [">= 0"])
122
+ s.add_dependency(%q<terminal-notifier>, [">= 0"])
123
+ s.add_dependency(%q<terminal-notifier-guard>, [">= 0"])
124
+ s.add_dependency(%q<guard-rspec>, [">= 0"])
125
+ s.add_dependency(%q<guard>, [">= 0"])
126
+ s.add_dependency(%q<doc_smoosher>, [">= 0"])
127
+ s.add_dependency(%q<sinatra>, [">= 0"])
128
+ s.add_dependency(%q<rspec>, [">= 0"])
129
+ end
130
+ end
131
+
@@ -0,0 +1,387 @@
1
+ $LOAD_PATH << '.'
2
+ require 'bundler/setup'
3
+ require 'doc_smoosher'
4
+
5
+ extend DocSmoosher::TopLevel
6
+
7
+ # Shared fields
8
+ limit = define_parameter( name: 'limit' ) do |p|
9
+ p.description = 'How many results to return'
10
+ p.type = :integer
11
+ p.default = 50
12
+ end
13
+
14
+ offset = define_parameter( name: 'offset' ) do |p|
15
+ p.description = 'Offset returned results by this amount'
16
+ p.type = :integer
17
+ p.default = 0
18
+ end
19
+
20
+ api_key = define_parameter( name: 'api_key' ) do |p|
21
+ p.description = 'Your API key'
22
+ p.type = :string
23
+ p.required = true
24
+ p.example = "hg7JHG6daSgf56FjhgsSa"
25
+ end
26
+
27
+ full_text = define_parameter( name: 'full_text' ) do |p|
28
+ p.description = 'Should the results be shown with all their text'
29
+ p.type = :boolean
30
+ p.default = false
31
+ end
32
+
33
+ # Item JSON POST form
34
+ json_item_post = define_object( name: 'item' ) do |item|
35
+ item.description = "A text item"
36
+ item.parameter name: 'text' do |p|
37
+ p.description = 'Your item\'s content'
38
+ p.type = :string
39
+ p.max = 50_000
40
+ end
41
+
42
+ item.parameter name: 'id' do |p|
43
+ p.description = 'Custom text/numeric id. This can be used for mapping items back to your own dataset without needing to store the item\'s generated id from ingenia.'
44
+ p.type = :string
45
+ p.example = '785uU423aC'
46
+ end
47
+
48
+ item.parameter name: 'tag_ids' do |p|
49
+ p.description = "The tags you want to have associated with this text item."
50
+ p.type = :array
51
+ p.example = '[ "politics", "education", "r&d" ]'
52
+ end
53
+
54
+ item.parameter name: 'tag_sets' do |p|
55
+ p.description = "Groups of tags that you consider of the same type; tags will come as belonging of a tag set"
56
+ p.type = :hash
57
+ p.example = '{ "category": [ "politics", "education", "r&d" ], "geography": [ "united kingdom" ] }'
58
+ end
59
+
60
+ item.example = '{"created_at":"2013-12-16T11:24:52+00:00","id":"e19e134d0e79153349ff78a674283e0b","last_classified_at":null,"text":"What type of cheese is the best cheese?","updated_at":"2013-12-16T11:24:56+00:00","tag_sets":[{"Cookery":{"id":107,"tags":["cheese"]}}}]}'
61
+ end
62
+
63
+ # Item JSON get form
64
+ json_item_show = define_object( name: 'item' ) do |item|
65
+ item.description = "A text item"
66
+ item.parameter name: 'text' do |p|
67
+ p.description = 'Your item\'s content'
68
+ p.type = :string
69
+ p.max = 50_000
70
+ end
71
+
72
+ item.parameter name: 'created_at' do |p|
73
+ p.description = 'When this item was created'
74
+ p.type = :date_time
75
+ p.example = '2013-12-16T11:24:52+00:00'
76
+ end
77
+ item.parameter name: 'updated_at' do |p|
78
+ p.description = 'When this item was last updated'
79
+ p.type = :date_time
80
+ p.example = '2013-12-16T11:24:52+00:00'
81
+ end
82
+ item.parameter name: 'last_classified_at' do |p|
83
+ p.description = 'When this item was last classified by the system, or null if it has yet to be classified.'
84
+ p.type = :date_time
85
+ p.example = 'null'
86
+ end
87
+
88
+ item.parameter name: 'id' do |p|
89
+ p.description = 'Custom text/numeric id. This can be used for mapping items back to your own dataset without needing to store the item\'s generated id from ingenia.'
90
+ p.type = :string
91
+ p.example = '785uU423aC'
92
+ end
93
+
94
+ item.example = '{"created_at":"2013-12-16T11:24:52+00:00","id":"e19e134d0e79153349ff78a674283e0b","last_classified_at":null,"text":"What type of cheese is the best cheese?","updated_at":"2013-12-16T11:24:56+00:00","tag_sets":[{"Cookery":{"id":107,"tags":["cheese"]}}}]}'
95
+ end
96
+
97
+ # Tag JSON POST form
98
+ json_tag = define_object( name: 'tag' ) do |tag|
99
+ tag.description = "A JSON tag"
100
+ tag.parameter name: 'name' do |p|
101
+ p.description = 'The name of your tag'
102
+ p.type = :string
103
+ end
104
+
105
+ tag.parameter name: 'tag_set_id' do |p|
106
+ p.description = 'The ID of the tag_set that this tag belongs to.'
107
+ p.type = :integer
108
+ p.example = '3'
109
+ p.required = true
110
+ end
111
+
112
+ tag.parameter name: 'description' do |p|
113
+ p.description = "Textual description of this tag."
114
+ p.type = :string
115
+ end
116
+
117
+ tag.parameter name: 'disposition' do |p|
118
+ p.description = "The disposition of the tag. Float value between 0 and 1, defaults to 0.5. Lower values will tend to privilege precision (we suggest 0.25); higher values will tend to privilege recall (we suggest 0.75). For most uses, the default value will work well.
119
+
120
+ You will want to privilege precision (with a disposition < 0.5) if you want each tag assignment to be accurate, and are less worried about some items being missed, i.e., you prefer to have false negatives than false positives. If the disposition is 0, no item will be tagged with this tag.
121
+
122
+ You will want to privilege recall (with a disposition > 0.5) if you want each tag assignment to occur, and are less worried about some items being tagged incorrectly, i.e., you prefer to have false positives than false negatives. If the disposition is 1, all items will be tagged with this tag."
123
+ p.type = :float
124
+ p.example = 0.7
125
+ p.default = 0.5
126
+ end
127
+ end
128
+
129
+ # TagSet JSON POST form
130
+ json_tag_set = define_object( name: 'tag_set' ) do |tag_set|
131
+ tag_set.description = "A tag set"
132
+ tag_set.parameter name: 'name' do |p|
133
+ p.description = 'The name of your tag set'
134
+ p.type = :string
135
+ end
136
+ end
137
+
138
+
139
+ # item_json = define_parameter( name: 'json' ) do |p|
140
+ # p.description = 'JSON encoded string containing a hash of fields for the text item.'
141
+ # p.type = :json
142
+ # p.required = false
143
+ # p.parameter(json_item)
144
+ # end
145
+
146
+
147
+ define_api( name: 'Ingenia API' ) do |api|
148
+ api.description = 'Ingenia analyses your textual content and automatically categorises it using your tags.'
149
+ api.endpoint = 'api.ingeniapi.com/v2/'
150
+ api.version = '2.0'
151
+ api.format = 'json'
152
+
153
+ api.object(json_item)
154
+ api.object(json_tag)
155
+ api.object(json_tag_set)
156
+
157
+ ##
158
+ # Items
159
+ #
160
+ api.resource name: 'items' do |r|
161
+ r.description = "Nuggets of textual content: somewhat self-contained and homogeneous."
162
+
163
+ r.request name: 'index' do |req|
164
+ req.description = 'An index of all your items'
165
+ req.call_type = :get
166
+ req.path = '/items'
167
+
168
+ req.parameter api_key
169
+ req.parameter limit
170
+ req.parameter full_text
171
+ req.parameter offset
172
+ end
173
+
174
+ r.request name: 'show' do |req|
175
+ req.description = 'View a single item'
176
+ req.call_type = :get
177
+ req.path = '/items/:id'
178
+
179
+ req.parameter api_key
180
+ req.parameter full_text
181
+ req.parameter name: 'id' do |p|
182
+ p.description = 'The ID of the item you want to show.'
183
+ p.type = :string
184
+ p.example = '3casjghd67'
185
+ p.required = true
186
+ end
187
+ end
188
+
189
+ r.request name: 'create' do |req|
190
+ req.description = 'Create a new item'
191
+ req.call_type = :post
192
+ req.path = '/items'
193
+
194
+ req.parameter name: 'file' do |p|
195
+ p.description = 'File to be used as text source. Sent as multipart upload. Accepted file extensions are; Text (txt), Postscript Document Format (pdf) and Microsoft Office Documents (doc, docx, xlsx, ppt, pptx).'
196
+ p.type = :multipart
197
+ end
198
+
199
+ req.parameter name: 'update_existing' do |p|
200
+ p.description = 'If the same text is sent, should the existing item be updated on Ingenia? If true then any tags supplied will overwrite those set on the existing item (default). If false, no data is changed and a response is returned with a 409 code (Conflict) together with the existing item as JSON.'
201
+ p.default = true
202
+ end
203
+
204
+ req.parameter name: 'classify' do |p|
205
+ p.description = 'Should the response also include a classification.'
206
+ p.default = false
207
+ end
208
+
209
+ req.parameter api_key
210
+ req.parameter json_item
211
+ end
212
+
213
+ r.request name: 'update' do |req|
214
+ req.description = 'Update an existing item'
215
+ req.call_type = :put
216
+ req.path = '/items/:id'
217
+
218
+ req.parameter name: 'id' do |p|
219
+ p.description = 'The ID of the item you want to update.'
220
+ p.type = :string
221
+ p.example = '3casjghd67'
222
+ p.required = true
223
+ end
224
+ req.parameter api_key
225
+ req.parameter json_item
226
+ req.parameter name: 'file' do |p|
227
+ p.description = 'File to be used as text source. Sent as multipart upload. Accepted file extensions are; Text (txt), Postscript Document Format (pdf) and Microsoft Office Documents (doc, docx, xlsx, ppt, pptx).'
228
+ p.type = :multipart
229
+ end
230
+ end
231
+
232
+ r.request name: 'delete' do |req|
233
+ req.description = 'Delete an existing item'
234
+ req.call_type = :delete
235
+ req.path = '/items/:id'
236
+
237
+ req.parameter name: 'id' do |p|
238
+ p.description = 'The ID of the item you want to delete.'
239
+ p.type = :string
240
+ p.example = '3casjghd67'
241
+ p.required = true
242
+ end
243
+ req.parameter api_key
244
+ end
245
+ end
246
+
247
+ ##
248
+ # Tags
249
+ #
250
+ api.resource name: 'tags' do |r|
251
+ r.description = "Tags are meaningful words or expressions that you want to associate to some or all your content items."
252
+
253
+ r.request name: 'index' do |req|
254
+ req.description = 'An index of all your tags'
255
+ req.call_type = :get
256
+ req.path = '/tags'
257
+
258
+ req.parameter api_key
259
+ req.parameter limit
260
+ req.parameter offset
261
+ end
262
+
263
+ r.request name: 'show' do |req|
264
+ req.description = 'View a single tag'
265
+ req.call_type = :get
266
+ req.path = '/tags/:id'
267
+
268
+ req.parameter name: 'id' do |p|
269
+ p.description = 'The ID of the tag you want to show.'
270
+ p.type = :integer
271
+ p.example = '42'
272
+ p.required = true
273
+ end
274
+ req.parameter api_key
275
+ end
276
+
277
+ r.request name: 'create' do |req|
278
+ req.description = 'Create a new tag'
279
+ req.call_type = :post
280
+ req.path = '/tags'
281
+
282
+ req.parameter api_key
283
+ req.parameter json_tag
284
+ end
285
+
286
+ r.request name: 'update' do |req|
287
+ req.description = 'Update an existing tag'
288
+ req.call_type = :put
289
+ req.path = '/tags/:id'
290
+
291
+ req.parameter name: 'id' do |p|
292
+ p.description = 'The ID of the tag you want to update.'
293
+ p.type = :integer
294
+ p.example = '42'
295
+ p.required = true
296
+ end
297
+ req.parameter api_key
298
+ end
299
+
300
+ r.request name: 'delete' do |req|
301
+ req.description = 'Delete an existing tag'
302
+ req.call_type = :delete
303
+ req.path = '/tags/:id'
304
+
305
+ req.parameter name: 'id' do |p|
306
+ p.description = 'The ID of the tag you want to delete.'
307
+ p.type = :integer
308
+ p.example = '42'
309
+ p.required = true
310
+ end
311
+ req.parameter api_key
312
+ end
313
+ end
314
+
315
+ ##
316
+ # Tag Sets
317
+ #
318
+ api.resource name: 'tag_sets' do |r|
319
+ r.description = "Tag sets are thematically consistent groups of tags, such as, say, world countries, business sectors, product types, companies, concepts, topics, etc."
320
+
321
+ r.request name: 'index' do |req|
322
+ req.description = 'An index of all your Tag Sets'
323
+ req.call_type = :get
324
+ req.path = '/tag_sets'
325
+
326
+ req.parameter api_key
327
+ req.parameter limit
328
+ req.parameter offset
329
+ end
330
+
331
+ r.request name: 'show' do |req|
332
+ req.description = 'View a single Tag Set'
333
+ req.call_type = :get
334
+ req.path = '/tag_sets/:id'
335
+
336
+ req.parameter name: 'id' do |p|
337
+ p.description = 'The ID of the Tag Set you want to show.'
338
+ p.type = :integer
339
+ p.example = '412'
340
+ p.required = true
341
+ end
342
+ req.parameter api_key
343
+ end
344
+
345
+ r.request name: 'create' do |req|
346
+ req.description = 'Create a new Tag Set'
347
+ req.call_type = :post
348
+ req.path = '/tag_sets'
349
+
350
+ req.parameter api_key
351
+ req.parameter json_tag_set
352
+ end
353
+
354
+ r.request name: 'update' do |req|
355
+ req.description = 'Update an existing Tag Set'
356
+ req.call_type = :put
357
+ req.path = '/tag_sets/:id'
358
+
359
+ req.parameter name: 'id' do |p|
360
+ p.description = 'The ID of the Tag Set you want to update.'
361
+ p.type = :integer
362
+ p.example = '412'
363
+ p.required = true
364
+ end
365
+ req.parameter api_key
366
+ req.parameter json_tag_set
367
+ end
368
+
369
+ r.request name: 'delete' do |req|
370
+ req.description = 'Delete an existing Tag Set'
371
+ req.call_type = :delete
372
+ req.path = '/tag_sets/:id'
373
+
374
+ req.parameter name: 'id' do |p|
375
+ p.description = 'The ID of the Tag Set you want to delete.'
376
+ p.type = :integer
377
+ p.example = '412'
378
+ p.required = true
379
+ end
380
+ req.parameter api_key
381
+ end
382
+ end
383
+ end
384
+
385
+ @api = api
386
+
387
+ api.to_json