Skip to content

Commit 194f2c4

Browse files
committed
[examples] Add "type: object" to the definitons
Fixes #558
1 parent bd9e444 commit 194f2c4

File tree

8 files changed

+229
-211
lines changed

8 files changed

+229
-211
lines changed

app/scripts/directives/tryoperation.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,9 @@ SwaggerEditor.controller('TryOperation', function ($scope, formdataFilter,
342342
securityOptions = securityOptions.concat(key);
343343
});
344344
});
345-
}
346345

347346
// root level securities
348-
else if (_.isArray($scope.specs.security)) {
347+
} else if (_.isArray($scope.specs.security)) {
349348
$scope.specs.security.map(function (security) {
350349
_.keys(security).forEach(function (key) {
351350
securityOptions = securityOptions.concat(key);

app/spec-files/default.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ paths:
181181
$ref: '#/definitions/Error'
182182
definitions:
183183
Product:
184+
type: object
184185
properties:
185186
product_id:
186187
type: string
@@ -198,6 +199,7 @@ definitions:
198199
type: string
199200
description: Image URL representing the product.
200201
PriceEstimate:
202+
type: object
201203
properties:
202204
product_id:
203205
type: string
@@ -221,6 +223,7 @@ definitions:
221223
type: number
222224
description: Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier.
223225
Profile:
226+
type: object
224227
properties:
225228
first_name:
226229
type: string
@@ -238,11 +241,13 @@ definitions:
238241
type: string
239242
description: Promo code of the Uber user.
240243
Activity:
244+
type: object
241245
properties:
242246
uuid:
243247
type: string
244248
description: Unique identifier for the activity
245249
Activities:
250+
type: object
246251
properties:
247252
offset:
248253
type: integer
@@ -261,6 +266,7 @@ definitions:
261266
items:
262267
$ref: '#/definitions/Activity'
263268
Error:
269+
type: object
264270
properties:
265271
code:
266272
type: integer

app/spec-files/heroku-pets.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ paths:
7171
description: Sends the pet with pet Id
7272

7373
definitions:
74+
type: object
7475
Pet:
7576
properties:
7677
name:

app/spec-files/instagram.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,7 @@ definitions:
10421042
name:
10431043
type: string
10441044
Image:
1045+
type: object
10451046
properties:
10461047
width:
10471048
type: integer
@@ -1050,6 +1051,7 @@ definitions:
10501051
url:
10511052
type: string
10521053
MiniProfile:
1054+
type: object
10531055
description: A shorter version of User for likes array
10541056
properties:
10551057
user_name:

app/spec-files/petstore_full.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ securityDefinitions:
492492
read_pets: read your pets
493493
definitions:
494494
User:
495+
type: object
495496
properties:
496497
id:
497498
type: integer
@@ -513,13 +514,15 @@ definitions:
513514
format: int32
514515
description: User Status
515516
Category:
517+
type: object
516518
properties:
517519
id:
518520
type: integer
519521
format: int64
520522
name:
521523
type: string
522524
Pet:
525+
type: object
523526
required:
524527
- name
525528
- photoUrls
@@ -544,13 +547,15 @@ definitions:
544547
type: string
545548
description: pet status in the store
546549
Tag:
550+
type: object
547551
properties:
548552
id:
549553
type: integer
550554
format: int64
551555
name:
552556
type: string
553557
Order:
558+
type: object
554559
properties:
555560
id:
556561
type: integer

app/spec-files/petstore_simple.yaml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ paths:
120120
$ref: '#/definitions/errorModel'
121121
definitions:
122122
pet:
123+
type: object
123124
required:
124125
- id
125126
- name
@@ -132,17 +133,19 @@ definitions:
132133
tag:
133134
type: string
134135
newPet:
135-
required:
136-
- name
137-
properties:
138-
id:
139-
type: integer
140-
format: int64
141-
name:
142-
type: string
143-
tag:
144-
type: string
136+
type: object
137+
required:
138+
- name
139+
properties:
140+
id:
141+
type: integer
142+
format: int64
143+
name:
144+
type: string
145+
tag:
146+
type: string
145147
errorModel:
148+
type: object
146149
required:
147150
- code
148151
- message

app/spec-files/security.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ securityDefinitions:
150150
name: api_key
151151
definitions:
152152
Pet:
153+
type: object
153154
required:
154155
- name
155156
properties:
@@ -158,6 +159,7 @@ definitions:
158159
tag:
159160
type: string
160161
ErrorModel:
162+
type: object
161163
required:
162164
- code
163165
- message

0 commit comments

Comments
 (0)