Browse code

Generate ErrorResponse struct from swagger spec.

Signed-off-by: Daniel Nephin <dnephin@docker.com>

Daniel Nephin authored on 2016/10/07 01:40:38
Showing 4 changed files
... ...
@@ -1063,7 +1063,7 @@ definitions:
1063 1063
       message:
1064 1064
         type: "integer"
1065 1065
 
1066
-  Error:
1066
+  ErrorResponse:
1067 1067
     description: "Represents an error."
1068 1068
     type: "object"
1069 1069
     required: ["message"]
... ...
@@ -1071,6 +1071,7 @@ definitions:
1071 1071
       message:
1072 1072
         description: "The error message."
1073 1073
         type: "string"
1074
+        x-nullable: false
1074 1075
     example:
1075 1076
       message: "Something went wrong."
1076 1077
 
... ...
@@ -2382,11 +2383,11 @@ paths:
2382 2382
         400:
2383 2383
           description: "bad parameter"
2384 2384
           schema:
2385
-            $ref: "#/definitions/Error"
2385
+            $ref: "#/definitions/ErrorResponse"
2386 2386
         500:
2387 2387
           description: "server error"
2388 2388
           schema:
2389
-            $ref: "#/definitions/Error"
2389
+            $ref: "#/definitions/ErrorResponse"
2390 2390
       tags:
2391 2391
         - "Container"
2392 2392
   /containers/create:
... ...
@@ -2559,26 +2560,26 @@ paths:
2559 2559
         400:
2560 2560
           description: "bad parameter"
2561 2561
           schema:
2562
-            $ref: "#/definitions/Error"
2562
+            $ref: "#/definitions/ErrorResponse"
2563 2563
         404:
2564 2564
           description: "no such container"
2565 2565
           schema:
2566
-            $ref: "#/definitions/Error"
2566
+            $ref: "#/definitions/ErrorResponse"
2567 2567
           examples:
2568 2568
             application/json:
2569 2569
               message: "No such container: c2ada9df5af8"
2570 2570
         406:
2571 2571
           description: "impossible to attach"
2572 2572
           schema:
2573
-            $ref: "#/definitions/Error"
2573
+            $ref: "#/definitions/ErrorResponse"
2574 2574
         409:
2575 2575
           description: "conflict"
2576 2576
           schema:
2577
-            $ref: "#/definitions/Error"
2577
+            $ref: "#/definitions/ErrorResponse"
2578 2578
         500:
2579 2579
           description: "server error"
2580 2580
           schema:
2581
-            $ref: "#/definitions/Error"
2581
+            $ref: "#/definitions/ErrorResponse"
2582 2582
       tags:
2583 2583
         - "Container"
2584 2584
   /containers/{id}/json:
... ...
@@ -2851,14 +2852,14 @@ paths:
2851 2851
         404:
2852 2852
           description: "no such container"
2853 2853
           schema:
2854
-            $ref: "#/definitions/Error"
2854
+            $ref: "#/definitions/ErrorResponse"
2855 2855
           examples:
2856 2856
             application/json:
2857 2857
               message: "No such container: c2ada9df5af8"
2858 2858
         500:
2859 2859
           description: "server error"
2860 2860
           schema:
2861
-            $ref: "#/definitions/Error"
2861
+            $ref: "#/definitions/ErrorResponse"
2862 2862
       parameters:
2863 2863
         - name: "id"
2864 2864
           in: "path"
... ...
@@ -2928,14 +2929,14 @@ paths:
2928 2928
         404:
2929 2929
           description: "no such container"
2930 2930
           schema:
2931
-            $ref: "#/definitions/Error"
2931
+            $ref: "#/definitions/ErrorResponse"
2932 2932
           examples:
2933 2933
             application/json:
2934 2934
               message: "No such container: c2ada9df5af8"
2935 2935
         500:
2936 2936
           description: "server error"
2937 2937
           schema:
2938
-            $ref: "#/definitions/Error"
2938
+            $ref: "#/definitions/ErrorResponse"
2939 2939
       parameters:
2940 2940
         - name: "id"
2941 2941
           in: "path"
... ...
@@ -2970,14 +2971,14 @@ paths:
2970 2970
         404:
2971 2971
           description: "no such container"
2972 2972
           schema:
2973
-            $ref: "#/definitions/Error"
2973
+            $ref: "#/definitions/ErrorResponse"
2974 2974
           examples:
2975 2975
             application/json:
2976 2976
               message: "No such container: c2ada9df5af8"
2977 2977
         500:
2978 2978
           description: "server error"
2979 2979
           schema:
2980
-            $ref: "#/definitions/Error"
2980
+            $ref: "#/definitions/ErrorResponse"
2981 2981
       parameters:
2982 2982
         - name: "id"
2983 2983
           in: "path"
... ...
@@ -3060,14 +3061,14 @@ paths:
3060 3060
         404:
3061 3061
           description: "no such container"
3062 3062
           schema:
3063
-            $ref: "#/definitions/Error"
3063
+            $ref: "#/definitions/ErrorResponse"
3064 3064
           examples:
3065 3065
             application/json:
3066 3066
               message: "No such container: c2ada9df5af8"
3067 3067
         500:
3068 3068
           description: "server error"
3069 3069
           schema:
3070
-            $ref: "#/definitions/Error"
3070
+            $ref: "#/definitions/ErrorResponse"
3071 3071
       parameters:
3072 3072
         - name: "id"
3073 3073
           in: "path"
... ...
@@ -3089,14 +3090,14 @@ paths:
3089 3089
         404:
3090 3090
           description: "no such container"
3091 3091
           schema:
3092
-            $ref: "#/definitions/Error"
3092
+            $ref: "#/definitions/ErrorResponse"
3093 3093
           examples:
3094 3094
             application/json:
3095 3095
               message: "No such container: c2ada9df5af8"
3096 3096
         500:
3097 3097
           description: "server error"
3098 3098
           schema:
3099
-            $ref: "#/definitions/Error"
3099
+            $ref: "#/definitions/ErrorResponse"
3100 3100
       parameters:
3101 3101
         - name: "id"
3102 3102
           in: "path"
... ...
@@ -3213,14 +3214,14 @@ paths:
3213 3213
         404:
3214 3214
           description: "no such container"
3215 3215
           schema:
3216
-            $ref: "#/definitions/Error"
3216
+            $ref: "#/definitions/ErrorResponse"
3217 3217
           examples:
3218 3218
             application/json:
3219 3219
               message: "No such container: c2ada9df5af8"
3220 3220
         500:
3221 3221
           description: "server error"
3222 3222
           schema:
3223
-            $ref: "#/definitions/Error"
3223
+            $ref: "#/definitions/ErrorResponse"
3224 3224
       parameters:
3225 3225
         - name: "id"
3226 3226
           in: "path"
... ...
@@ -3249,14 +3250,14 @@ paths:
3249 3249
         404:
3250 3250
           description: "no such container"
3251 3251
           schema:
3252
-            $ref: "#/definitions/Error"
3252
+            $ref: "#/definitions/ErrorResponse"
3253 3253
           examples:
3254 3254
             application/json:
3255 3255
               message: "No such container: c2ada9df5af8"
3256 3256
         500:
3257 3257
           description: "cannot resize container"
3258 3258
           schema:
3259
-            $ref: "#/definitions/Error"
3259
+            $ref: "#/definitions/ErrorResponse"
3260 3260
       parameters:
3261 3261
         - name: "id"
3262 3262
           in: "path"
... ...
@@ -3283,18 +3284,18 @@ paths:
3283 3283
         304:
3284 3284
           description: "container already started"
3285 3285
           schema:
3286
-            $ref: "#/definitions/Error"
3286
+            $ref: "#/definitions/ErrorResponse"
3287 3287
         404:
3288 3288
           description: "no such container"
3289 3289
           schema:
3290
-            $ref: "#/definitions/Error"
3290
+            $ref: "#/definitions/ErrorResponse"
3291 3291
           examples:
3292 3292
             application/json:
3293 3293
               message: "No such container: c2ada9df5af8"
3294 3294
         500:
3295 3295
           description: "server error"
3296 3296
           schema:
3297
-            $ref: "#/definitions/Error"
3297
+            $ref: "#/definitions/ErrorResponse"
3298 3298
       parameters:
3299 3299
         - name: "id"
3300 3300
           in: "path"
... ...
@@ -3317,18 +3318,18 @@ paths:
3317 3317
         304:
3318 3318
           description: "container already stopped"
3319 3319
           schema:
3320
-            $ref: "#/definitions/Error"
3320
+            $ref: "#/definitions/ErrorResponse"
3321 3321
         404:
3322 3322
           description: "no such container"
3323 3323
           schema:
3324
-            $ref: "#/definitions/Error"
3324
+            $ref: "#/definitions/ErrorResponse"
3325 3325
           examples:
3326 3326
             application/json:
3327 3327
               message: "No such container: c2ada9df5af8"
3328 3328
         500:
3329 3329
           description: "server error"
3330 3330
           schema:
3331
-            $ref: "#/definitions/Error"
3331
+            $ref: "#/definitions/ErrorResponse"
3332 3332
       parameters:
3333 3333
         - name: "id"
3334 3334
           in: "path"
... ...
@@ -3351,14 +3352,14 @@ paths:
3351 3351
         404:
3352 3352
           description: "no such container"
3353 3353
           schema:
3354
-            $ref: "#/definitions/Error"
3354
+            $ref: "#/definitions/ErrorResponse"
3355 3355
           examples:
3356 3356
             application/json:
3357 3357
               message: "No such container: c2ada9df5af8"
3358 3358
         500:
3359 3359
           description: "server error"
3360 3360
           schema:
3361
-            $ref: "#/definitions/Error"
3361
+            $ref: "#/definitions/ErrorResponse"
3362 3362
       parameters:
3363 3363
         - name: "id"
3364 3364
           in: "path"
... ...
@@ -3382,14 +3383,14 @@ paths:
3382 3382
         404:
3383 3383
           description: "no such container"
3384 3384
           schema:
3385
-            $ref: "#/definitions/Error"
3385
+            $ref: "#/definitions/ErrorResponse"
3386 3386
           examples:
3387 3387
             application/json:
3388 3388
               message: "No such container: c2ada9df5af8"
3389 3389
         500:
3390 3390
           description: "server error"
3391 3391
           schema:
3392
-            $ref: "#/definitions/Error"
3392
+            $ref: "#/definitions/ErrorResponse"
3393 3393
       parameters:
3394 3394
         - name: "id"
3395 3395
           in: "path"
... ...
@@ -3425,14 +3426,14 @@ paths:
3425 3425
         404:
3426 3426
           description: "no such container"
3427 3427
           schema:
3428
-            $ref: "#/definitions/Error"
3428
+            $ref: "#/definitions/ErrorResponse"
3429 3429
           examples:
3430 3430
             application/json:
3431 3431
               message: "No such container: c2ada9df5af8"
3432 3432
         500:
3433 3433
           description: "server error"
3434 3434
           schema:
3435
-            $ref: "#/definitions/Error"
3435
+            $ref: "#/definitions/ErrorResponse"
3436 3436
       parameters:
3437 3437
         - name: "id"
3438 3438
           in: "path"
... ...
@@ -3475,18 +3476,18 @@ paths:
3475 3475
         404:
3476 3476
           description: "no such container"
3477 3477
           schema:
3478
-            $ref: "#/definitions/Error"
3478
+            $ref: "#/definitions/ErrorResponse"
3479 3479
           examples:
3480 3480
             application/json:
3481 3481
               message: "No such container: c2ada9df5af8"
3482 3482
         409:
3483 3483
           description: "name already in use"
3484 3484
           schema:
3485
-            $ref: "#/definitions/Error"
3485
+            $ref: "#/definitions/ErrorResponse"
3486 3486
         500:
3487 3487
           description: "server error"
3488 3488
           schema:
3489
-            $ref: "#/definitions/Error"
3489
+            $ref: "#/definitions/ErrorResponse"
3490 3490
       parameters:
3491 3491
         - name: "id"
3492 3492
           in: "path"
... ...
@@ -3514,14 +3515,14 @@ paths:
3514 3514
         404:
3515 3515
           description: "no such container"
3516 3516
           schema:
3517
-            $ref: "#/definitions/Error"
3517
+            $ref: "#/definitions/ErrorResponse"
3518 3518
           examples:
3519 3519
             application/json:
3520 3520
               message: "No such container: c2ada9df5af8"
3521 3521
         500:
3522 3522
           description: "server error"
3523 3523
           schema:
3524
-            $ref: "#/definitions/Error"
3524
+            $ref: "#/definitions/ErrorResponse"
3525 3525
       parameters:
3526 3526
         - name: "id"
3527 3527
           in: "path"
... ...
@@ -3541,14 +3542,14 @@ paths:
3541 3541
         404:
3542 3542
           description: "no such container"
3543 3543
           schema:
3544
-            $ref: "#/definitions/Error"
3544
+            $ref: "#/definitions/ErrorResponse"
3545 3545
           examples:
3546 3546
             application/json:
3547 3547
               message: "No such container: c2ada9df5af8"
3548 3548
         500:
3549 3549
           description: "server error"
3550 3550
           schema:
3551
-            $ref: "#/definitions/Error"
3551
+            $ref: "#/definitions/ErrorResponse"
3552 3552
       parameters:
3553 3553
         - name: "id"
3554 3554
           in: "path"
... ...
@@ -3648,18 +3649,18 @@ paths:
3648 3648
         400:
3649 3649
           description: "bad parameter"
3650 3650
           schema:
3651
-            $ref: "#/definitions/Error"
3651
+            $ref: "#/definitions/ErrorResponse"
3652 3652
         404:
3653 3653
           description: "no such container"
3654 3654
           schema:
3655
-            $ref: "#/definitions/Error"
3655
+            $ref: "#/definitions/ErrorResponse"
3656 3656
           examples:
3657 3657
             application/json:
3658 3658
               message: "No such container: c2ada9df5af8"
3659 3659
         500:
3660 3660
           description: "server error"
3661 3661
           schema:
3662
-            $ref: "#/definitions/Error"
3662
+            $ref: "#/definitions/ErrorResponse"
3663 3663
       parameters:
3664 3664
         - name: "id"
3665 3665
           in: "path"
... ...
@@ -3714,18 +3715,18 @@ paths:
3714 3714
         400:
3715 3715
           description: "bad parameter"
3716 3716
           schema:
3717
-            $ref: "#/definitions/Error"
3717
+            $ref: "#/definitions/ErrorResponse"
3718 3718
         404:
3719 3719
           description: "no such container"
3720 3720
           schema:
3721
-            $ref: "#/definitions/Error"
3721
+            $ref: "#/definitions/ErrorResponse"
3722 3722
           examples:
3723 3723
             application/json:
3724 3724
               message: "No such container: c2ada9df5af8"
3725 3725
         500:
3726 3726
           description: "server error"
3727 3727
           schema:
3728
-            $ref: "#/definitions/Error"
3728
+            $ref: "#/definitions/ErrorResponse"
3729 3729
       parameters:
3730 3730
         - name: "id"
3731 3731
           in: "path"
... ...
@@ -3782,14 +3783,14 @@ paths:
3782 3782
         404:
3783 3783
           description: "no such container"
3784 3784
           schema:
3785
-            $ref: "#/definitions/Error"
3785
+            $ref: "#/definitions/ErrorResponse"
3786 3786
           examples:
3787 3787
             application/json:
3788 3788
               message: "No such container: c2ada9df5af8"
3789 3789
         500:
3790 3790
           description: "server error"
3791 3791
           schema:
3792
-            $ref: "#/definitions/Error"
3792
+            $ref: "#/definitions/ErrorResponse"
3793 3793
       parameters:
3794 3794
         - name: "id"
3795 3795
           in: "path"
... ...
@@ -3808,18 +3809,18 @@ paths:
3808 3808
         400:
3809 3809
           description: "bad parameter"
3810 3810
           schema:
3811
-            $ref: "#/definitions/Error"
3811
+            $ref: "#/definitions/ErrorResponse"
3812 3812
         404:
3813 3813
           description: "no such container"
3814 3814
           schema:
3815
-            $ref: "#/definitions/Error"
3815
+            $ref: "#/definitions/ErrorResponse"
3816 3816
           examples:
3817 3817
             application/json:
3818 3818
               message: "No such container: c2ada9df5af8"
3819 3819
         500:
3820 3820
           description: "server error"
3821 3821
           schema:
3822
-            $ref: "#/definitions/Error"
3822
+            $ref: "#/definitions/ErrorResponse"
3823 3823
       parameters:
3824 3824
         - name: "id"
3825 3825
           in: "path"
... ...
@@ -3853,18 +3854,18 @@ paths:
3853 3853
         400:
3854 3854
           description: "client error, bad parameter, details in JSON response body, one of: must specify path parameter (path cannot be empty) not a directory (path was asserted to be a directory but exists as a file)"
3855 3855
           schema:
3856
-            $ref: "#/definitions/Error"
3856
+            $ref: "#/definitions/ErrorResponse"
3857 3857
         404:
3858 3858
           description: "client error, resource not found, one of: 1) no such container (container id does not exist) 2) no such file or directory (path resource does not exist)"
3859 3859
           schema:
3860
-            $ref: "#/definitions/Error"
3860
+            $ref: "#/definitions/ErrorResponse"
3861 3861
           examples:
3862 3862
             application/json:
3863 3863
               message: "No such container: c2ada9df5af8"
3864 3864
         500:
3865 3865
           description: "server error"
3866 3866
           schema:
3867
-            $ref: "#/definitions/Error"
3867
+            $ref: "#/definitions/ErrorResponse"
3868 3868
       parameters:
3869 3869
         - name: "id"
3870 3870
           in: "path"
... ...
@@ -3890,18 +3891,18 @@ paths:
3890 3890
         400:
3891 3891
           description: "client error, bad parameter, details in JSON response body, one of: must specify path parameter (path cannot be empty) not a directory (path was asserted to be a directory but exists as a file)"
3892 3892
           schema:
3893
-            $ref: "#/definitions/Error"
3893
+            $ref: "#/definitions/ErrorResponse"
3894 3894
         404:
3895 3895
           description: "client error, resource not found, one of: 1) no such container (container id does not exist) 2) no such file or directory (path resource does not exist)"
3896 3896
           schema:
3897
-            $ref: "#/definitions/Error"
3897
+            $ref: "#/definitions/ErrorResponse"
3898 3898
           examples:
3899 3899
             application/json:
3900 3900
               message: "No such container: c2ada9df5af8"
3901 3901
         500:
3902 3902
           description: "server error"
3903 3903
           schema:
3904
-            $ref: "#/definitions/Error"
3904
+            $ref: "#/definitions/ErrorResponse"
3905 3905
       parameters:
3906 3906
         - name: "id"
3907 3907
           in: "path"
... ...
@@ -3928,22 +3929,22 @@ paths:
3928 3928
         400:
3929 3929
           description: "Bad parameter"
3930 3930
           schema:
3931
-            $ref: "#/definitions/Error"
3931
+            $ref: "#/definitions/ErrorResponse"
3932 3932
         403:
3933 3933
           description: "Permission denied, the volume or container rootfs is marked as read-only."
3934 3934
           schema:
3935
-            $ref: "#/definitions/Error"
3935
+            $ref: "#/definitions/ErrorResponse"
3936 3936
         404:
3937 3937
           description: "No such container or path does not exist inside the container"
3938 3938
           schema:
3939
-            $ref: "#/definitions/Error"
3939
+            $ref: "#/definitions/ErrorResponse"
3940 3940
           examples:
3941 3941
             application/json:
3942 3942
               message: "No such container: c2ada9df5af8"
3943 3943
         500:
3944 3944
           description: "Server error"
3945 3945
           schema:
3946
-            $ref: "#/definitions/Error"
3946
+            $ref: "#/definitions/ErrorResponse"
3947 3947
       parameters:
3948 3948
         - name: "id"
3949 3949
           in: "path"
... ...
@@ -4005,7 +4006,7 @@ paths:
4005 4005
         500:
4006 4006
           description: "server error"
4007 4007
           schema:
4008
-            $ref: "#/definitions/Error"
4008
+            $ref: "#/definitions/ErrorResponse"
4009 4009
       parameters:
4010 4010
         - name: "all"
4011 4011
           in: "query"
... ...
@@ -4155,7 +4156,7 @@ paths:
4155 4155
         500:
4156 4156
           description: "server error"
4157 4157
           schema:
4158
-            $ref: "#/definitions/Error"
4158
+            $ref: "#/definitions/ErrorResponse"
4159 4159
       tags:
4160 4160
         - "Image"
4161 4161
   /images/create:
... ...
@@ -4174,7 +4175,7 @@ paths:
4174 4174
         500:
4175 4175
           description: "server error"
4176 4176
           schema:
4177
-            $ref: "#/definitions/Error"
4177
+            $ref: "#/definitions/ErrorResponse"
4178 4178
       parameters:
4179 4179
         - name: "fromImage"
4180 4180
           in: "query"
... ...
@@ -4302,14 +4303,14 @@ paths:
4302 4302
         404:
4303 4303
           description: "No such image"
4304 4304
           schema:
4305
-            $ref: "#/definitions/Error"
4305
+            $ref: "#/definitions/ErrorResponse"
4306 4306
           examples:
4307 4307
             application/json:
4308 4308
               message: "No such image: someimage (tag: latest)"
4309 4309
         500:
4310 4310
           description: "Server error"
4311 4311
           schema:
4312
-            $ref: "#/definitions/Error"
4312
+            $ref: "#/definitions/ErrorResponse"
4313 4313
       parameters:
4314 4314
         - name: "name"
4315 4315
           in: "path"
... ...
@@ -4376,11 +4377,11 @@ paths:
4376 4376
         404:
4377 4377
           description: "No such image"
4378 4378
           schema:
4379
-            $ref: "#/definitions/Error"
4379
+            $ref: "#/definitions/ErrorResponse"
4380 4380
         500:
4381 4381
           description: "Server error"
4382 4382
           schema:
4383
-            $ref: "#/definitions/Error"
4383
+            $ref: "#/definitions/ErrorResponse"
4384 4384
       parameters:
4385 4385
         - name: "name"
4386 4386
           in: "path"
... ...
@@ -4407,11 +4408,11 @@ paths:
4407 4407
         404:
4408 4408
           description: "No such image"
4409 4409
           schema:
4410
-            $ref: "#/definitions/Error"
4410
+            $ref: "#/definitions/ErrorResponse"
4411 4411
         500:
4412 4412
           description: "Server error"
4413 4413
           schema:
4414
-            $ref: "#/definitions/Error"
4414
+            $ref: "#/definitions/ErrorResponse"
4415 4415
       parameters:
4416 4416
         - name: "name"
4417 4417
           in: "path"
... ...
@@ -4440,19 +4441,19 @@ paths:
4440 4440
         400:
4441 4441
           description: "Bad parameter"
4442 4442
           schema:
4443
-            $ref: "#/definitions/Error"
4443
+            $ref: "#/definitions/ErrorResponse"
4444 4444
         404:
4445 4445
           description: "No such image"
4446 4446
           schema:
4447
-            $ref: "#/definitions/Error"
4447
+            $ref: "#/definitions/ErrorResponse"
4448 4448
         409:
4449 4449
           description: "Conflict"
4450 4450
           schema:
4451
-            $ref: "#/definitions/Error"
4451
+            $ref: "#/definitions/ErrorResponse"
4452 4452
         500:
4453 4453
           description: "Server error"
4454 4454
           schema:
4455
-            $ref: "#/definitions/Error"
4455
+            $ref: "#/definitions/ErrorResponse"
4456 4456
       parameters:
4457 4457
         - name: "name"
4458 4458
           in: "path"
... ...
@@ -4501,15 +4502,15 @@ paths:
4501 4501
         404:
4502 4502
           description: "No such image"
4503 4503
           schema:
4504
-            $ref: "#/definitions/Error"
4504
+            $ref: "#/definitions/ErrorResponse"
4505 4505
         409:
4506 4506
           description: "Conflict"
4507 4507
           schema:
4508
-            $ref: "#/definitions/Error"
4508
+            $ref: "#/definitions/ErrorResponse"
4509 4509
         500:
4510 4510
           description: "Server error"
4511 4511
           schema:
4512
-            $ref: "#/definitions/Error"
4512
+            $ref: "#/definitions/ErrorResponse"
4513 4513
       parameters:
4514 4514
         - name: "name"
4515 4515
           in: "path"
... ...
@@ -4573,7 +4574,7 @@ paths:
4573 4573
         500:
4574 4574
           description: "Server error"
4575 4575
           schema:
4576
-            $ref: "#/definitions/Error"
4576
+            $ref: "#/definitions/ErrorResponse"
4577 4577
       parameters:
4578 4578
         - name: "term"
4579 4579
           in: "query"
... ...
@@ -4625,7 +4626,7 @@ paths:
4625 4625
         500:
4626 4626
           description: "Server error"
4627 4627
           schema:
4628
-            $ref: "#/definitions/Error"
4628
+            $ref: "#/definitions/ErrorResponse"
4629 4629
       parameters:
4630 4630
         - name: "authConfig"
4631 4631
           in: "body"
... ...
@@ -4840,7 +4841,7 @@ paths:
4840 4840
         500:
4841 4841
           description: "Server error"
4842 4842
           schema:
4843
-            $ref: "#/definitions/Error"
4843
+            $ref: "#/definitions/ErrorResponse"
4844 4844
       tags:
4845 4845
         - "Misc"
4846 4846
   /version:
... ...
@@ -4888,7 +4889,7 @@ paths:
4888 4888
         500:
4889 4889
           description: "server error"
4890 4890
           schema:
4891
-            $ref: "#/definitions/Error"
4891
+            $ref: "#/definitions/ErrorResponse"
4892 4892
       tags:
4893 4893
         - "Misc"
4894 4894
   /_ping:
... ...
@@ -4907,7 +4908,7 @@ paths:
4907 4907
         500:
4908 4908
           description: "server error"
4909 4909
           schema:
4910
-            $ref: "#/definitions/Error"
4910
+            $ref: "#/definitions/ErrorResponse"
4911 4911
       tags:
4912 4912
         - "Misc"
4913 4913
   /commit:
... ...
@@ -4933,14 +4934,14 @@ paths:
4933 4933
         404:
4934 4934
           description: "no such container"
4935 4935
           schema:
4936
-            $ref: "#/definitions/Error"
4936
+            $ref: "#/definitions/ErrorResponse"
4937 4937
           examples:
4938 4938
             application/json:
4939 4939
               message: "No such container: c2ada9df5af8"
4940 4940
         500:
4941 4941
           description: "server error"
4942 4942
           schema:
4943
-            $ref: "#/definitions/Error"
4943
+            $ref: "#/definitions/ErrorResponse"
4944 4944
       parameters:
4945 4945
         - name: "containerConfig"
4946 4946
           in: "body"
... ...
@@ -5043,7 +5044,7 @@ paths:
5043 5043
         500:
5044 5044
           description: "server error"
5045 5045
           schema:
5046
-            $ref: "#/definitions/Error"
5046
+            $ref: "#/definitions/ErrorResponse"
5047 5047
       parameters:
5048 5048
         - name: "since"
5049 5049
           in: "query"
... ...
@@ -5108,7 +5109,7 @@ paths:
5108 5108
         500:
5109 5109
           description: "server error"
5110 5110
           schema:
5111
-            $ref: "#/definitions/Error"
5111
+            $ref: "#/definitions/ErrorResponse"
5112 5112
       parameters:
5113 5113
         - name: "name"
5114 5114
           in: "path"
... ...
@@ -5138,7 +5139,7 @@ paths:
5138 5138
         500:
5139 5139
           description: "server error"
5140 5140
           schema:
5141
-            $ref: "#/definitions/Error"
5141
+            $ref: "#/definitions/ErrorResponse"
5142 5142
       parameters:
5143 5143
         - name: "names"
5144 5144
           in: "query"
... ...
@@ -5166,7 +5167,7 @@ paths:
5166 5166
         500:
5167 5167
           description: "server error"
5168 5168
           schema:
5169
-            $ref: "#/definitions/Error"
5169
+            $ref: "#/definitions/ErrorResponse"
5170 5170
       parameters:
5171 5171
         - name: "imagesTarball"
5172 5172
           in: "body"
... ...
@@ -5205,18 +5206,18 @@ paths:
5205 5205
         404:
5206 5206
           description: "no such container"
5207 5207
           schema:
5208
-            $ref: "#/definitions/Error"
5208
+            $ref: "#/definitions/ErrorResponse"
5209 5209
           examples:
5210 5210
             application/json:
5211 5211
               message: "No such container: c2ada9df5af8"
5212 5212
         409:
5213 5213
           description: "container is paused"
5214 5214
           schema:
5215
-            $ref: "#/definitions/Error"
5215
+            $ref: "#/definitions/ErrorResponse"
5216 5216
         500:
5217 5217
           description: "Server error"
5218 5218
           schema:
5219
-            $ref: "#/definitions/Error"
5219
+            $ref: "#/definitions/ErrorResponse"
5220 5220
       parameters:
5221 5221
         - name: "execConfig"
5222 5222
           in: "body"
... ...
@@ -5275,11 +5276,11 @@ paths:
5275 5275
         404:
5276 5276
           description: "No such exec instance"
5277 5277
           schema:
5278
-            $ref: "#/definitions/Error"
5278
+            $ref: "#/definitions/ErrorResponse"
5279 5279
         409:
5280 5280
           description: "Container is stopped or paused"
5281 5281
           schema:
5282
-            $ref: "#/definitions/Error"
5282
+            $ref: "#/definitions/ErrorResponse"
5283 5283
       parameters:
5284 5284
         - name: "execStartConfig"
5285 5285
           in: "body"
... ...
@@ -5313,7 +5314,7 @@ paths:
5313 5313
         404:
5314 5314
           description: "No such exec instance"
5315 5315
           schema:
5316
-            $ref: "#/definitions/Error"
5316
+            $ref: "#/definitions/ErrorResponse"
5317 5317
       parameters:
5318 5318
         - name: "id"
5319 5319
           in: "path"
... ...
@@ -5381,11 +5382,11 @@ paths:
5381 5381
         404:
5382 5382
           description: "No such exec instance"
5383 5383
           schema:
5384
-            $ref: "#/definitions/Error"
5384
+            $ref: "#/definitions/ErrorResponse"
5385 5385
         500:
5386 5386
           description: "Server error"
5387 5387
           schema:
5388
-            $ref: "#/definitions/Error"
5388
+            $ref: "#/definitions/ErrorResponse"
5389 5389
       parameters:
5390 5390
         - name: "id"
5391 5391
           in: "path"
... ...
@@ -5434,7 +5435,7 @@ paths:
5434 5434
         500:
5435 5435
           description: "Server error"
5436 5436
           schema:
5437
-            $ref: "#/definitions/Error"
5437
+            $ref: "#/definitions/ErrorResponse"
5438 5438
       parameters:
5439 5439
         - name: "filters"
5440 5440
           in: "query"
... ...
@@ -5467,7 +5468,7 @@ paths:
5467 5467
         500:
5468 5468
           description: "Server error"
5469 5469
           schema:
5470
-            $ref: "#/definitions/Error"
5470
+            $ref: "#/definitions/ErrorResponse"
5471 5471
       parameters:
5472 5472
         - name: "volumeConfig"
5473 5473
           in: "body"
... ...
@@ -5514,11 +5515,11 @@ paths:
5514 5514
         404:
5515 5515
           description: "No such volume"
5516 5516
           schema:
5517
-            $ref: "#/definitions/Error"
5517
+            $ref: "#/definitions/ErrorResponse"
5518 5518
         500:
5519 5519
           description: "Server error"
5520 5520
           schema:
5521
-            $ref: "#/definitions/Error"
5521
+            $ref: "#/definitions/ErrorResponse"
5522 5522
       parameters:
5523 5523
         - name: "name"
5524 5524
           in: "path"
... ...
@@ -5537,15 +5538,15 @@ paths:
5537 5537
         404:
5538 5538
           description: "No such volume or volume driver"
5539 5539
           schema:
5540
-            $ref: "#/definitions/Error"
5540
+            $ref: "#/definitions/ErrorResponse"
5541 5541
         409:
5542 5542
           description: "Volume is in use and cannot be removed"
5543 5543
           schema:
5544
-            $ref: "#/definitions/Error"
5544
+            $ref: "#/definitions/ErrorResponse"
5545 5545
         500:
5546 5546
           description: "Server error"
5547 5547
           schema:
5548
-            $ref: "#/definitions/Error"
5548
+            $ref: "#/definitions/ErrorResponse"
5549 5549
       parameters:
5550 5550
         - name: "name"
5551 5551
           in: "path"
... ...
@@ -5618,7 +5619,7 @@ paths:
5618 5618
         500:
5619 5619
           description: "Server error"
5620 5620
           schema:
5621
-            $ref: "#/definitions/Error"
5621
+            $ref: "#/definitions/ErrorResponse"
5622 5622
       parameters:
5623 5623
         - name: "filters"
5624 5624
           in: "query"
... ...
@@ -5647,7 +5648,7 @@ paths:
5647 5647
         404:
5648 5648
           description: "Network not found"
5649 5649
           schema:
5650
-            $ref: "#/definitions/Error"
5650
+            $ref: "#/definitions/ErrorResponse"
5651 5651
       parameters:
5652 5652
         - name: "id"
5653 5653
           in: "path"
... ...
@@ -5665,11 +5666,11 @@ paths:
5665 5665
         404:
5666 5666
           description: "no such network"
5667 5667
           schema:
5668
-            $ref: "#/definitions/Error"
5668
+            $ref: "#/definitions/ErrorResponse"
5669 5669
         500:
5670 5670
           description: "Server error"
5671 5671
           schema:
5672
-            $ref: "#/definitions/Error"
5672
+            $ref: "#/definitions/ErrorResponse"
5673 5673
       parameters:
5674 5674
         - name: "id"
5675 5675
           in: "path"
... ...
@@ -5703,11 +5704,11 @@ paths:
5703 5703
         404:
5704 5704
           description: "plugin not found"
5705 5705
           schema:
5706
-            $ref: "#/definitions/Error"
5706
+            $ref: "#/definitions/ErrorResponse"
5707 5707
         500:
5708 5708
           description: "Server error"
5709 5709
           schema:
5710
-            $ref: "#/definitions/Error"
5710
+            $ref: "#/definitions/ErrorResponse"
5711 5711
       parameters:
5712 5712
         - name: "networkConfig"
5713 5713
           in: "body"
... ...
@@ -5785,15 +5786,15 @@ paths:
5785 5785
         403:
5786 5786
           description: "Operation not supported for swarm scoped networks"
5787 5787
           schema:
5788
-            $ref: "#/definitions/Error"
5788
+            $ref: "#/definitions/ErrorResponse"
5789 5789
         404:
5790 5790
           description: "Network or container not found"
5791 5791
           schema:
5792
-            $ref: "#/definitions/Error"
5792
+            $ref: "#/definitions/ErrorResponse"
5793 5793
         500:
5794 5794
           description: "Server error"
5795 5795
           schema:
5796
-            $ref: "#/definitions/Error"
5796
+            $ref: "#/definitions/ErrorResponse"
5797 5797
       parameters:
5798 5798
         - name: "id"
5799 5799
           in: "path"
... ...
@@ -5831,15 +5832,15 @@ paths:
5831 5831
         403:
5832 5832
           description: "Operation not supported for swarm scoped networks"
5833 5833
           schema:
5834
-            $ref: "#/definitions/Error"
5834
+            $ref: "#/definitions/ErrorResponse"
5835 5835
         404:
5836 5836
           description: "Network or container not found"
5837 5837
           schema:
5838
-            $ref: "#/definitions/Error"
5838
+            $ref: "#/definitions/ErrorResponse"
5839 5839
         500:
5840 5840
           description: "Server error"
5841 5841
           schema:
5842
-            $ref: "#/definitions/Error"
5842
+            $ref: "#/definitions/ErrorResponse"
5843 5843
       parameters:
5844 5844
         - name: "id"
5845 5845
           in: "path"
... ...
@@ -5952,7 +5953,7 @@ paths:
5952 5952
         500:
5953 5953
           description: "Server error"
5954 5954
           schema:
5955
-            $ref: "#/definitions/Error"
5955
+            $ref: "#/definitions/ErrorResponse"
5956 5956
       tags:
5957 5957
         - "Plugins"
5958 5958
   /plugins/pull:
... ...
@@ -5996,7 +5997,7 @@ paths:
5996 5996
         500:
5997 5997
           description: "server error"
5998 5998
           schema:
5999
-            $ref: "#/definitions/Error"
5999
+            $ref: "#/definitions/ErrorResponse"
6000 6000
       parameters:
6001 6001
         - name: "name"
6002 6002
           in: "query"
... ...
@@ -6024,11 +6025,11 @@ paths:
6024 6024
         404:
6025 6025
           description: "plugin is not installed"
6026 6026
           schema:
6027
-            $ref: "#/definitions/Error"
6027
+            $ref: "#/definitions/ErrorResponse"
6028 6028
         500:
6029 6029
           description: "server error"
6030 6030
           schema:
6031
-            $ref: "#/definitions/Error"
6031
+            $ref: "#/definitions/ErrorResponse"
6032 6032
       parameters:
6033 6033
         - name: "name"
6034 6034
           in: "path"
... ...
@@ -6048,11 +6049,11 @@ paths:
6048 6048
         404:
6049 6049
           description: "plugin is not installed"
6050 6050
           schema:
6051
-            $ref: "#/definitions/Error"
6051
+            $ref: "#/definitions/ErrorResponse"
6052 6052
         500:
6053 6053
           description: "server error"
6054 6054
           schema:
6055
-            $ref: "#/definitions/Error"
6055
+            $ref: "#/definitions/ErrorResponse"
6056 6056
       parameters:
6057 6057
         - name: "name"
6058 6058
           in: "path"
... ...
@@ -6076,7 +6077,7 @@ paths:
6076 6076
         500:
6077 6077
           description: "server error"
6078 6078
           schema:
6079
-            $ref: "#/definitions/Error"
6079
+            $ref: "#/definitions/ErrorResponse"
6080 6080
       parameters:
6081 6081
         - name: "name"
6082 6082
           in: "path"
... ...
@@ -6095,7 +6096,7 @@ paths:
6095 6095
         500:
6096 6096
           description: "server error"
6097 6097
           schema:
6098
-            $ref: "#/definitions/Error"
6098
+            $ref: "#/definitions/ErrorResponse"
6099 6099
       parameters:
6100 6100
         - name: "name"
6101 6101
           in: "path"
... ...
@@ -6118,7 +6119,7 @@ paths:
6118 6118
         500:
6119 6119
           description: "server error"
6120 6120
           schema:
6121
-            $ref: "#/definitions/Error"
6121
+            $ref: "#/definitions/ErrorResponse"
6122 6122
       parameters:
6123 6123
         - name: "filters"
6124 6124
           in: "query"
... ...
@@ -6145,11 +6146,11 @@ paths:
6145 6145
         404:
6146 6146
           description: "no such node"
6147 6147
           schema:
6148
-            $ref: "#/definitions/Error"
6148
+            $ref: "#/definitions/ErrorResponse"
6149 6149
         500:
6150 6150
           description: "server error"
6151 6151
           schema:
6152
-            $ref: "#/definitions/Error"
6152
+            $ref: "#/definitions/ErrorResponse"
6153 6153
       parameters:
6154 6154
         - name: "id"
6155 6155
           in: "path"
... ...
@@ -6167,11 +6168,11 @@ paths:
6167 6167
         404:
6168 6168
           description: "no such node"
6169 6169
           schema:
6170
-            $ref: "#/definitions/Error"
6170
+            $ref: "#/definitions/ErrorResponse"
6171 6171
         500:
6172 6172
           description: "server error"
6173 6173
           schema:
6174
-            $ref: "#/definitions/Error"
6174
+            $ref: "#/definitions/ErrorResponse"
6175 6175
       parameters:
6176 6176
         - name: "id"
6177 6177
           in: "path"
... ...
@@ -6195,11 +6196,11 @@ paths:
6195 6195
         404:
6196 6196
           description: "no such node"
6197 6197
           schema:
6198
-            $ref: "#/definitions/Error"
6198
+            $ref: "#/definitions/ErrorResponse"
6199 6199
         500:
6200 6200
           description: "server error"
6201 6201
           schema:
6202
-            $ref: "#/definitions/Error"
6202
+            $ref: "#/definitions/ErrorResponse"
6203 6203
       parameters:
6204 6204
         - name: "id"
6205 6205
           in: "path"
... ...
@@ -6266,7 +6267,7 @@ paths:
6266 6266
         500:
6267 6267
           description: "server error"
6268 6268
           schema:
6269
-            $ref: "#/definitions/Error"
6269
+            $ref: "#/definitions/ErrorResponse"
6270 6270
       tags:
6271 6271
         - "Swarm"
6272 6272
   /swarm/init:
... ...
@@ -6286,15 +6287,15 @@ paths:
6286 6286
         400:
6287 6287
           description: "bad parameter"
6288 6288
           schema:
6289
-            $ref: "#/definitions/Error"
6289
+            $ref: "#/definitions/ErrorResponse"
6290 6290
         406:
6291 6291
           description: "node is already part of a swarm"
6292 6292
           schema:
6293
-            $ref: "#/definitions/Error"
6293
+            $ref: "#/definitions/ErrorResponse"
6294 6294
         500:
6295 6295
           description: "server error"
6296 6296
           schema:
6297
-            $ref: "#/definitions/Error"
6297
+            $ref: "#/definitions/ErrorResponse"
6298 6298
       parameters:
6299 6299
         - name: "body"
6300 6300
           in: "body"
... ...
@@ -6334,15 +6335,15 @@ paths:
6334 6334
         400:
6335 6335
           description: "bad parameter"
6336 6336
           schema:
6337
-            $ref: "#/definitions/Error"
6337
+            $ref: "#/definitions/ErrorResponse"
6338 6338
         406:
6339 6339
           description: "node is already part of a swarm"
6340 6340
           schema:
6341
-            $ref: "#/definitions/Error"
6341
+            $ref: "#/definitions/ErrorResponse"
6342 6342
         500:
6343 6343
           description: "server error"
6344 6344
           schema:
6345
-            $ref: "#/definitions/Error"
6345
+            $ref: "#/definitions/ErrorResponse"
6346 6346
       parameters:
6347 6347
         - name: "body"
6348 6348
           in: "body"
... ...
@@ -6380,11 +6381,11 @@ paths:
6380 6380
         406:
6381 6381
           description: "node is not part of a swarm"
6382 6382
           schema:
6383
-            $ref: "#/definitions/Error"
6383
+            $ref: "#/definitions/ErrorResponse"
6384 6384
         500:
6385 6385
           description: "server error"
6386 6386
           schema:
6387
-            $ref: "#/definitions/Error"
6387
+            $ref: "#/definitions/ErrorResponse"
6388 6388
       parameters:
6389 6389
         - name: "force"
6390 6390
           description: "Force leave swarm, even if this is the last manager or that it will break the cluster."
... ...
@@ -6403,15 +6404,15 @@ paths:
6403 6403
         400:
6404 6404
           description: "bad parameter"
6405 6405
           schema:
6406
-            $ref: "#/definitions/Error"
6406
+            $ref: "#/definitions/ErrorResponse"
6407 6407
         406:
6408 6408
           description: "node is not part of a swarm"
6409 6409
           schema:
6410
-            $ref: "#/definitions/Error"
6410
+            $ref: "#/definitions/ErrorResponse"
6411 6411
         500:
6412 6412
           description: "server error"
6413 6413
           schema:
6414
-            $ref: "#/definitions/Error"
6414
+            $ref: "#/definitions/ErrorResponse"
6415 6415
       parameters:
6416 6416
         - name: "body"
6417 6417
           in: "body"
... ...
@@ -6450,7 +6451,7 @@ paths:
6450 6450
         500:
6451 6451
           description: "server error"
6452 6452
           schema:
6453
-            $ref: "#/definitions/Error"
6453
+            $ref: "#/definitions/ErrorResponse"
6454 6454
       parameters:
6455 6455
         - name: "filters"
6456 6456
           in: "query"
... ...
@@ -6484,15 +6485,15 @@ paths:
6484 6484
         406:
6485 6485
           description: "server error or node is not part of a swarm"
6486 6486
           schema:
6487
-            $ref: "#/definitions/Error"
6487
+            $ref: "#/definitions/ErrorResponse"
6488 6488
         409:
6489 6489
           description: "name conflicts with an existing service"
6490 6490
           schema:
6491
-            $ref: "#/definitions/Error"
6491
+            $ref: "#/definitions/ErrorResponse"
6492 6492
         500:
6493 6493
           description: "server error"
6494 6494
           schema:
6495
-            $ref: "#/definitions/Error"
6495
+            $ref: "#/definitions/ErrorResponse"
6496 6496
       parameters:
6497 6497
         - name: "body"
6498 6498
           in: "body"
... ...
@@ -6563,11 +6564,11 @@ paths:
6563 6563
         404:
6564 6564
           description: "no such service"
6565 6565
           schema:
6566
-            $ref: "#/definitions/Error"
6566
+            $ref: "#/definitions/ErrorResponse"
6567 6567
         500:
6568 6568
           description: "server error"
6569 6569
           schema:
6570
-            $ref: "#/definitions/Error"
6570
+            $ref: "#/definitions/ErrorResponse"
6571 6571
       parameters:
6572 6572
         - name: "id"
6573 6573
           in: "path"
... ...
@@ -6585,11 +6586,11 @@ paths:
6585 6585
         404:
6586 6586
           description: "no such service"
6587 6587
           schema:
6588
-            $ref: "#/definitions/Error"
6588
+            $ref: "#/definitions/ErrorResponse"
6589 6589
         500:
6590 6590
           description: "server error"
6591 6591
           schema:
6592
-            $ref: "#/definitions/Error"
6592
+            $ref: "#/definitions/ErrorResponse"
6593 6593
       parameters:
6594 6594
         - name: "id"
6595 6595
           in: "path"
... ...
@@ -6608,11 +6609,11 @@ paths:
6608 6608
         404:
6609 6609
           description: "no such service"
6610 6610
           schema:
6611
-            $ref: "#/definitions/Error"
6611
+            $ref: "#/definitions/ErrorResponse"
6612 6612
         500:
6613 6613
           description: "server error"
6614 6614
           schema:
6615
-            $ref: "#/definitions/Error"
6615
+            $ref: "#/definitions/ErrorResponse"
6616 6616
       parameters:
6617 6617
         - name: "id"
6618 6618
           in: "path"
... ...
@@ -6787,7 +6788,7 @@ paths:
6787 6787
         500:
6788 6788
           description: "server error"
6789 6789
           schema:
6790
-            $ref: "#/definitions/Error"
6790
+            $ref: "#/definitions/ErrorResponse"
6791 6791
       parameters:
6792 6792
         - name: "filters"
6793 6793
           in: "query"
... ...
@@ -6817,11 +6818,11 @@ paths:
6817 6817
         404:
6818 6818
           description: "no such task"
6819 6819
           schema:
6820
-            $ref: "#/definitions/Error"
6820
+            $ref: "#/definitions/ErrorResponse"
6821 6821
         500:
6822 6822
           description: "server error"
6823 6823
           schema:
6824
-            $ref: "#/definitions/Error"
6824
+            $ref: "#/definitions/ErrorResponse"
6825 6825
       parameters:
6826 6826
         - name: "id"
6827 6827
           in: "path"
6828 6828
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+package types
1
+
2
+// This file was generated by the swagger tool.
3
+// Editing this file might prove futile when you re-run the swagger generate command
4
+
5
+/*ErrorResponse Represents an error.
6
+
7
+swagger:model ErrorResponse
8
+*/
9
+type ErrorResponse struct {
10
+
11
+	/* The error message.
12
+
13
+	Required: true
14
+	*/
15
+	Message string `json:"message"`
16
+}
0 17
deleted file mode 100644
... ...
@@ -1,6 +0,0 @@
1
-package types
2
-
3
-// ErrorResponse is the response body of API errors.
4
-type ErrorResponse struct {
5
-	Message string `json:"message"`
6
-}
... ...
@@ -6,7 +6,8 @@ swagger generate model -f api/swagger.yaml \
6 6
     -n Volume \
7 7
     -n Port \
8 8
     -n ImageSummary \
9
-    -n Plugin -n PluginDevice -n PluginMount -n PluginEnv -n PluginInterfaceType
9
+    -n Plugin -n PluginDevice -n PluginMount -n PluginEnv -n PluginInterfaceType \
10
+    -n ErrorResponse
10 11
 
11 12
 swagger generate operation -f api/swagger.yaml \
12 13
     -t api -s server -a types -m types \