jdoc 0.1.0 → 0.1.1

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: ecaf31b4e9cc6005cf7980e77b5f8967a9d1e4a1
4
- data.tar.gz: 449ee41071bbf4467556d1150418f32bf686b530
3
+ metadata.gz: 9cba6d88f3a7501c3c240ed691dee7f1f68a3b73
4
+ data.tar.gz: 08d484a97ce19deac8f5a50f32dc5103e925144a
5
5
  SHA512:
6
- metadata.gz: 6f1bc864b397b9c4bd30ff0a936a5856e2a965d47773a195a91c00267e807231872831b85f4cef362578fce891dfdd00b3bc82312a58c924cd5070fbfb8419cd
7
- data.tar.gz: f1788851e9708e9ffc34eb8a8adafc3775f63c1eb789da355e0035a4ae33047e810c9932e22487b7fa073a4900d3e6f2e17f3571193556b7f11147b13c694ef6
6
+ metadata.gz: b78a21dc60b11f898b74aa700bf0cb0b90feebc8f9cbeeb2bc7604b16c2ff0fd2d08812d235bff86f5aa1869b02430fa16e7b5615d05f92a5389fb235304bc84
7
+ data.tar.gz: eae3dc35b17b5c6a1cf4836e4cb6eed22ca1f10a63735ace67d9cd055d42c7fd3c6758eeb25885e55bebf23bff94f9022a53c7d75f7044f213eb00d1bd2eb5ae
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.1.1
2
+ * Support has-one relation
3
+
1
4
  ## 0.1.0
2
5
  * Show resources which have no links
3
6
 
data/lib/jdoc/link.rb CHANGED
@@ -142,7 +142,7 @@ module Jdoc
142
142
  result.merge(
143
143
  key => case
144
144
  when !value.properties.empty?
145
- call(value)
145
+ call(value.properties)
146
146
  when !value.data["example"].nil?
147
147
  value.data["example"]
148
148
  when value.type.include?("null")
data/lib/jdoc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jdoc
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -86,6 +86,24 @@ definitions:
86
86
  type: array
87
87
  items:
88
88
  "$ref": "#/definitions/user"
89
+ recipe:
90
+ title: Recipe
91
+ type: object
92
+ definitions:
93
+ name:
94
+ type: string
95
+ example: "Sushi"
96
+ properties:
97
+ name:
98
+ "$ref": "#/definitions/recipe/definitions/name"
99
+ user:
100
+ "$ref": "#/definitions/user"
101
+ links:
102
+ - title: List
103
+ description: List recipes
104
+ method: GET
105
+ href: "/recipes"
106
+ rel: instances
89
107
  user:
90
108
  title: User
91
109
  type: object
@@ -99,6 +117,8 @@ definitions:
99
117
  properties:
100
118
  app:
101
119
  "$ref": "#/definitions/app"
120
+ recipe:
121
+ "$ref": "#/definitions/recipe"
102
122
  user:
103
123
  "$ref": "#/definitions/user"
104
124
  type:
@@ -25,6 +25,8 @@ describe Jdoc::Generator do
25
25
  * [GET /apps/:id](#get-appsid)
26
26
  * [GET /apps](#get-apps)
27
27
  * [PATCH /apps/:id](#patch-appsid)
28
+ * [Recipe](#recipe)
29
+ * [GET /recipes](#get-recipes)
28
30
  * [User](#user)
29
31
 
30
32
  ## App
@@ -187,6 +189,37 @@ describe Jdoc::Generator do
187
189
  }
188
190
  ```
189
191
 
192
+ ## Recipe
193
+
194
+
195
+ ### Properties
196
+ * name -
197
+ * Example: `"Sushi"`
198
+ * Type: string
199
+ * user -
200
+ * Type: object
201
+
202
+ ### GET /recipes
203
+ List recipes
204
+
205
+ ```
206
+ GET /recipes HTTP/1.1
207
+ Content-Type: application/json
208
+ Host: api.example.com
209
+ ```
210
+
211
+ ```
212
+ HTTP/1.1 200
213
+ Content-Type: application/json
214
+
215
+ {
216
+ "name": "Sushi",
217
+ "user": {
218
+ "name": "alice"
219
+ }
220
+ }
221
+ ```
222
+
190
223
  ## User
191
224
 
192
225
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura