diff --git a/modules/swagger-codegen/src/main/resources/python/api_client.mustache b/modules/swagger-codegen/src/main/resources/python/api_client.mustache index 969eb4e7992..d097ec4536d 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_client.mustache @@ -453,7 +453,9 @@ class ApiClient(object): for auth in auth_settings: auth_setting = config.auth_settings().get(auth) if auth_setting: - if auth_setting['in'] == 'header': + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'header': headers[auth_setting['key']] = auth_setting['value'] elif auth_setting['in'] == 'query': querys[auth_setting['key']] = auth_setting['value'] diff --git a/samples/client/petstore/python/.coverage b/samples/client/petstore/python/.coverage index 03f8b2a2d03..ddd00f77a03 100644 --- a/samples/client/petstore/python/.coverage +++ b/samples/client/petstore/python/.coverage @@ -1 +1 @@ -!coverage.py: This is a private format, don't read it directly!{"runs": [{"brief_sys": "CPython 3.4.3 Darwin"}], "lines": {"/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/user.py": [70, 136, 202, 272, 81, 147, 213, 22, 25, 92, 29, 158, 224, 103, 169, 235, 114, 19, 180, 30, 246, 266, 191, 125, 21], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/rest.py": [20, 21, 23, 24, 25, 26, 27, 28, 31, 33, 35, 36, 40, 42, 48, 51, 53, 54, 55, 56, 57, 59, 63, 65, 72, 74, 82, 83, 88, 92, 95, 98, 101, 102, 103, 104, 105, 106, 109, 110, 121, 122, 124, 129, 130, 132, 135, 137, 138, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, 153, 154, 155, 156, 159, 160, 161, 166, 170, 171, 174, 176, 177, 179, 181, 182, 183, 184, 186, 191, 198, 199, 200, 201, 203, 204, 205, 206, 207, 208, 210, 211, 212, 213, 214, 215, 217, 225, 227, 228, 229, 230, 231, 232, 239, 243, 244, 245, 246, 248, 249, 251], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/__init__.py": [1, 4, 5, 6, 7, 8], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/apis/__init__.py": [1, 4, 5, 6], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/tag.py": [72, 74, 109, 19, 21, 22, 104, 25, 29, 30, 96, 100, 114, 102, 39, 40, 41, 103, 44, 45, 46, 112, 49, 50, 83, 116, 94, 52, 122, 61, 85, 63], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/pet.py": [128, 130, 150, 172, 139, 141, 19, 215, 21, 22, 152, 25, 29, 30, 161, 163, 39, 40, 41, 42, 43, 44, 45, 174, 48, 49, 50, 51, 52, 53, 54, 183, 57, 58, 59, 60, 61, 62, 64, 194, 195, 200, 73, 202, 75, 206, 208, 209, 210, 211, 84, 213, 86, 185, 216, 218, 220, 222, 95, 97, 226, 228, 106, 108, 117, 119, 212], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/apis/pet_api.py": [469, 18, 20, 22, 23, 536, 26, 539, 28, 29, 69, 32, 545, 546, 548, 37, 39, 40, 41, 42, 555, 44, 557, 558, 559, 48, 561, 562, 564, 567, 568, 569, 70, 573, 574, 577, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 591, 80, 82, 83, 85, 87, 89, 91, 92, 94, 95, 96, 99, 100, 101, 614, 617, 618, 620, 621, 622, 111, 157, 113, 114, 627, 628, 106, 630, 631, 120, 633, 634, 635, 637, 639, 641, 642, 643, 644, 645, 646, 449, 648, 651, 652, 653, 109, 144, 657, 658, 147, 148, 661, 73, 663, 664, 665, 666, 155, 668, 538, 670, 671, 160, 112, 162, 164, 166, 167, 169, 170, 171, 174, 175, 176, 115, 180, 181, 184, 116, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 118, 198, 535, 119, 121, 219, 220, 222, 549, 224, 123, 229, 230, 232, 233, 551, 237, 238, 239, 552, 243, 244, 246, 553, 249, 250, 383, 255, 256, 259, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 673, 273, 46, 294, 295, 297, 298, 299, 304, 305, 307, 308, 310, 312, 313, 314, 223, 316, 318, 319, 321, 324, 325, 326, 330, 331, 45, 334, 336, 337, 338, 339, 340, 667, 342, 343, 344, 345, 346, 348, 540, 145, 483, 369, 372, 373, 375, 376, 377, 382, 149, 385, 386, 235, 388, 389, 390, 392, 394, 396, 397, 399, 402, 403, 404, 408, 409, 412, 154, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 426, 669, 72, 105, 158, 241, 74, 117, 672, 452, 453, 455, 456, 457, 462, 463, 465, 466, 468, 532, 470, 472, 474, 79, 476, 477, 478, 479, 480, 481, 251, 486, 487, 488, 492, 493, 496, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, 341], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/__init__.py": [1, 4, 5, 6, 7, 8, 11, 12, 13, 16, 18, 20], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/apis/store_api.py": [273, 18, 20, 22, 23, 26, 28, 29, 32, 37, 39, 40, 41, 44, 46, 48, 195, 68, 69, 71, 72, 79, 81, 82, 84, 86, 88, 90, 91, 93, 96, 97, 98, 102, 103, 106, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/category.py": [72, 74, 109, 19, 21, 22, 104, 25, 29, 30, 96, 100, 114, 102, 39, 40, 41, 103, 44, 45, 46, 112, 49, 50, 83, 116, 94, 52, 122, 61, 85, 63], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/order.py": [130, 44, 141, 45, 19, 21, 22, 152, 25, 29, 30, 52, 161, 163, 39, 40, 41, 42, 43, 172, 173, 174, 175, 48, 49, 50, 51, 180, 53, 54, 57, 58, 59, 60, 61, 62, 191, 64, 202, 75, 86, 176, 222, 97, 228, 178, 108, 119], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/api_client.py": [516, 523, 524, 525, 19, 21, 22, 535, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 40, 42, 44, 49, 52, 566, 567, 568, 569, 570, 571, 573, 68, 69, 70, 75, 76, 77, 79, 80, 82, 84, 91, 96, 98, 102, 103, 104, 107, 108, 109, 111, 112, 115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 129, 130, 131, 134, 137, 138, 23, 141, 144, 145, 146, 147, 149, 152, 153, 155, 157, 158, 160, 162, 171, 172, 174, 176, 191, 192, 544, 194, 195, 196, 197, 198, 199, 200, 201, 202, 204, 205, 212, 213, 214, 216, 217, 219, 231, 235, 236, 240, 242, 251, 252, 254, 255, 256, 257, 258, 260, 261, 262, 263, 556, 267, 268, 269, 272, 274, 275, 276, 278, 279, 280, 281, 283, 286, 287, 288, 564, 316, 317, 318, 319, 320, 322, 323, 324, 325, 326, 327, 328, 329, 330, 332, 333, 337, 338, 339, 340, 341, 345, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 369, 370, 371, 372, 379, 387, 389, 390, 392, 393, 394, 395, 397, 398, 399, 400, 401, 402, 404, 406, 413, 414, 416, 418, 419, 421, 423, 430, 431, 433, 435, 436, 438, 440, 501, 448, 450, 453, 454, 455, 456, 457, 465, 546, 491, 500, 545, 506, 508], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/configuration.py": [135, 136, 137, 138, 139, 142, 19, 149, 22, 23, 25, 26, 27, 29, 158, 31, 32, 34, 36, 37, 39, 40, 41, 170, 43, 172, 46, 47, 189, 179, 52, 54, 59, 61, 190, 63, 192, 224, 67, 69, 71, 200, 73, 204, 80, 81, 82, 84, 213, 86, 199, 88, 90, 219, 92, 221, 222, 223, 96, 225, 98, 100, 102, 230, 104, 167, 111, 76, 168, 157, 122, 123, 42, 21], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/apis/user_api.py": [32, 37, 198, 39, 423, 582, 48, 273, 18, 20, 501, 22, 23, 26, 123, 28, 29, 351]}} \ No newline at end of file +!coverage.py: This is a private format, don't read it directly!{"lines": {"/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/apis/pet_api.py": [512, 513, 514, 516, 86, 18, 20, 22, 23, 26, 539, 28, 29, 542, 543, 32, 548, 37, 39, 40, 41, 42, 555, 556, 45, 558, 559, 560, 562, 564, 565, 566, 568, 569, 571, 574, 575, 576, 580, 581, 70, 584, 73, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 598, 88, 90, 92, 93, 95, 96, 97, 100, 101, 102, 106, 107, 621, 622, 624, 625, 626, 79, 116, 117, 118, 631, 632, 121, 122, 635, 124, 638, 639, 641, 642, 643, 645, 647, 649, 650, 651, 652, 653, 654, 656, 145, 146, 659, 148, 661, 150, 665, 666, 155, 156, 538, 159, 160, 673, 162, 675, 164, 677, 166, 679, 168, 169, 171, 172, 173, 541, 176, 177, 178, 115, 182, 183, 186, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 552, 200, 119, 120, 377, 221, 222, 549, 224, 225, 226, 231, 232, 431, 235, 236, 110, 238, 240, 241, 242, 244, 246, 247, 249, 383, 252, 253, 254, 258, 259, 262, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 276, 46, 48, 297, 298, 300, 301, 302, 44, 307, 308, 311, 312, 314, 316, 317, 318, 320, 322, 323, 325, 113, 328, 329, 330, 334, 335, 338, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 485, 352, 84, 114, 373, 374, 376, 660, 378, 149, 384, 387, 390, 391, 393, 394, 395, 397, 399, 401, 402, 404, 407, 408, 409, 413, 414, 69, 417, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 669, 72, 671, 74, 672, 83, 454, 455, 457, 458, 459, 674, 112, 464, 465, 468, 471, 472, 676, 474, 475, 476, 478, 480, 80, 482, 483, 484, 678, 486, 487, 489, 492, 493, 494, 680, 498, 499, 502, 681, 504, 505, 506, 507, 508, 509, 510, 511], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/apis/user_api.py": [32, 355, 37, 39, 200, 124, 428, 589, 48, 18, 20, 22, 23, 276, 26, 507, 28, 29], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/api_client.py": [518, 525, 526, 527, 19, 21, 22, 23, 24, 537, 26, 27, 28, 29, 30, 31, 32, 33, 34, 547, 36, 37, 40, 42, 44, 558, 49, 52, 566, 568, 569, 570, 571, 572, 573, 575, 68, 69, 70, 75, 76, 77, 79, 80, 82, 84, 91, 96, 98, 102, 103, 104, 107, 108, 109, 111, 112, 115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 129, 130, 131, 134, 137, 138, 141, 144, 145, 146, 147, 149, 152, 153, 155, 157, 158, 160, 162, 171, 172, 174, 176, 191, 192, 194, 195, 196, 197, 198, 199, 200, 201, 202, 204, 205, 212, 213, 214, 216, 217, 219, 231, 235, 236, 240, 242, 251, 252, 254, 255, 256, 257, 258, 260, 261, 262, 263, 267, 268, 269, 272, 274, 275, 276, 278, 279, 280, 281, 283, 286, 287, 288, 316, 317, 318, 319, 320, 322, 323, 324, 325, 326, 327, 328, 329, 330, 332, 333, 337, 338, 339, 340, 341, 345, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 369, 370, 371, 372, 379, 387, 389, 390, 392, 393, 394, 395, 548, 397, 398, 399, 400, 401, 402, 404, 406, 413, 414, 416, 418, 419, 421, 423, 430, 431, 433, 435, 436, 438, 440, 448, 450, 453, 454, 455, 456, 458, 459, 467, 546, 493, 502, 503, 508, 510], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/category.py": [72, 74, 109, 19, 21, 22, 104, 25, 29, 30, 96, 100, 114, 102, 39, 40, 41, 103, 44, 45, 46, 112, 49, 50, 83, 116, 94, 52, 122, 61, 85, 63], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/rest.py": [20, 21, 23, 24, 25, 26, 27, 28, 31, 33, 35, 36, 40, 42, 48, 51, 53, 54, 55, 56, 57, 59, 63, 65, 72, 74, 82, 83, 88, 92, 95, 98, 101, 102, 103, 104, 105, 106, 109, 110, 121, 122, 124, 129, 130, 132, 135, 137, 138, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, 153, 154, 155, 156, 159, 160, 161, 166, 170, 171, 174, 176, 177, 179, 181, 182, 183, 184, 186, 191, 198, 199, 200, 201, 203, 204, 205, 206, 207, 208, 210, 211, 212, 213, 214, 215, 217, 225, 227, 228, 229, 230, 231, 232, 239, 243, 244, 245, 246, 248, 249, 251], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/__init__.py": [1, 4, 5, 6, 7, 8], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/apis/store_api.py": [18, 276, 22, 23, 26, 28, 29, 197, 32, 37, 39, 40, 41, 44, 46, 48, 20, 68, 69, 71, 72, 79, 82, 83, 85, 87, 89, 91, 92, 94, 97, 98, 99, 103, 104, 107, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 121], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/configuration.py": [135, 136, 137, 138, 139, 142, 19, 149, 22, 23, 25, 26, 27, 29, 158, 31, 32, 34, 36, 37, 39, 40, 41, 170, 43, 172, 46, 47, 189, 179, 52, 54, 59, 61, 190, 63, 192, 224, 67, 69, 71, 200, 73, 204, 80, 81, 82, 84, 213, 86, 199, 88, 90, 219, 92, 221, 222, 223, 96, 225, 98, 100, 102, 230, 104, 167, 111, 76, 168, 157, 122, 123, 42, 21], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/__init__.py": [1, 4, 5, 6, 7, 8, 11, 12, 13, 16, 18, 20], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/pet.py": [128, 130, 150, 172, 139, 141, 19, 215, 21, 22, 152, 25, 29, 30, 161, 163, 39, 40, 41, 42, 43, 44, 45, 174, 48, 49, 50, 51, 52, 53, 54, 183, 57, 58, 59, 60, 61, 62, 64, 194, 195, 200, 73, 202, 75, 206, 208, 209, 210, 211, 84, 213, 86, 185, 216, 218, 220, 222, 95, 97, 226, 228, 106, 108, 117, 119, 212], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/user.py": [70, 136, 202, 272, 81, 147, 213, 22, 25, 92, 29, 158, 224, 103, 169, 235, 114, 19, 180, 30, 246, 266, 191, 125, 21], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/apis/__init__.py": [1, 4, 5, 6], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/order.py": [130, 44, 141, 45, 19, 21, 22, 152, 25, 29, 30, 52, 161, 163, 39, 40, 41, 42, 43, 172, 173, 174, 175, 48, 49, 50, 51, 180, 53, 54, 57, 58, 59, 60, 61, 62, 191, 64, 202, 75, 86, 176, 222, 97, 228, 178, 108, 119], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/tag.py": [72, 74, 109, 19, 21, 22, 104, 25, 29, 30, 96, 100, 114, 102, 39, 40, 41, 103, 44, 45, 46, 112, 49, 50, 83, 116, 94, 52, 122, 61, 85, 63]}} \ No newline at end of file diff --git a/samples/client/petstore/python/dev-requirements.txt.log b/samples/client/petstore/python/dev-requirements.txt.log index 0d8dcbb5831..316a9394b50 100644 --- a/samples/client/petstore/python/dev-requirements.txt.log +++ b/samples/client/petstore/python/dev-requirements.txt.log @@ -20,3 +20,17 @@ Requirement already satisfied (use --upgrade to upgrade): randomize in ./.venv/l Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./.venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./.venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./.venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) diff --git a/samples/client/petstore/python/swagger_client/api_client.py b/samples/client/petstore/python/swagger_client/api_client.py index fdc92cae77f..f3c66bd3706 100644 --- a/samples/client/petstore/python/swagger_client/api_client.py +++ b/samples/client/petstore/python/swagger_client/api_client.py @@ -453,7 +453,9 @@ class ApiClient(object): for auth in auth_settings: auth_setting = config.auth_settings().get(auth) if auth_setting: - if auth_setting['in'] == 'header': + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'header': headers[auth_setting['key']] = auth_setting['value'] elif auth_setting['in'] == 'query': querys[auth_setting['key']] = auth_setting['value'] diff --git a/samples/client/petstore/python/swagger_client/apis/pet_api.py b/samples/client/petstore/python/swagger_client/apis/pet_api.py index d68d34e6774..d7bc11daaaf 100644 --- a/samples/client/petstore/python/swagger_client/apis/pet_api.py +++ b/samples/client/petstore/python/swagger_client/apis/pet_api.py @@ -79,6 +79,7 @@ class PetApi(object): params[key] = val del params['kwargs'] + resource_path = '/pet'.replace('{format}', 'json') method = 'PUT' @@ -154,6 +155,7 @@ class PetApi(object): params[key] = val del params['kwargs'] + resource_path = '/pet'.replace('{format}', 'json') method = 'POST' @@ -229,6 +231,7 @@ class PetApi(object): params[key] = val del params['kwargs'] + resource_path = '/pet/findByStatus'.replace('{format}', 'json') method = 'GET' @@ -304,6 +307,7 @@ class PetApi(object): params[key] = val del params['kwargs'] + resource_path = '/pet/findByTags'.replace('{format}', 'json') method = 'GET' @@ -365,9 +369,6 @@ class PetApi(object): If the method is called asynchronously, returns the request thread. """ - # verify the required parameter 'pet_id' is set - if pet_id is None: - raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") all_params = ['pet_id'] all_params.append('callback') @@ -382,6 +383,10 @@ class PetApi(object): params[key] = val del params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params) or (params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") + resource_path = '/pet/{petId}'.replace('{format}', 'json') method = 'GET' @@ -445,9 +450,6 @@ class PetApi(object): If the method is called asynchronously, returns the request thread. """ - # verify the required parameter 'pet_id' is set - if pet_id is None: - raise ValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") all_params = ['pet_id', 'name', 'status'] all_params.append('callback') @@ -462,6 +464,10 @@ class PetApi(object): params[key] = val del params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params) or (params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") + resource_path = '/pet/{petId}'.replace('{format}', 'json') method = 'POST' @@ -528,9 +534,6 @@ class PetApi(object): If the method is called asynchronously, returns the request thread. """ - # verify the required parameter 'pet_id' is set - if pet_id is None: - raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") all_params = ['pet_id', 'api_key'] all_params.append('callback') @@ -545,6 +548,10 @@ class PetApi(object): params[key] = val del params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params) or (params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") + resource_path = '/pet/{petId}'.replace('{format}', 'json') method = 'DELETE' @@ -610,9 +617,6 @@ class PetApi(object): If the method is called asynchronously, returns the request thread. """ - # verify the required parameter 'pet_id' is set - if pet_id is None: - raise ValueError("Missing the required parameter `pet_id` when calling `upload_file`") all_params = ['pet_id', 'additional_metadata', 'file'] all_params.append('callback') @@ -627,6 +631,10 @@ class PetApi(object): params[key] = val del params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params) or (params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `upload_file`") + resource_path = '/pet/{petId}/uploadImage'.replace('{format}', 'json') method = 'POST' diff --git a/samples/client/petstore/python/swagger_client/apis/store_api.py b/samples/client/petstore/python/swagger_client/apis/store_api.py index 9e08a0b2f47..e3835990a30 100644 --- a/samples/client/petstore/python/swagger_client/apis/store_api.py +++ b/samples/client/petstore/python/swagger_client/apis/store_api.py @@ -78,6 +78,7 @@ class StoreApi(object): params[key] = val del params['kwargs'] + resource_path = '/store/inventory'.replace('{format}', 'json') method = 'GET' @@ -151,6 +152,7 @@ class StoreApi(object): params[key] = val del params['kwargs'] + resource_path = '/store/order'.replace('{format}', 'json') method = 'POST' @@ -212,9 +214,6 @@ class StoreApi(object): If the method is called asynchronously, returns the request thread. """ - # verify the required parameter 'order_id' is set - if order_id is None: - raise ValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") all_params = ['order_id'] all_params.append('callback') @@ -229,6 +228,10 @@ class StoreApi(object): params[key] = val del params['kwargs'] + # verify the required parameter 'order_id' is set + if ('order_id' not in params) or (params['order_id'] is None): + raise ValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") + resource_path = '/store/order/{orderId}'.replace('{format}', 'json') method = 'GET' @@ -290,9 +293,6 @@ class StoreApi(object): If the method is called asynchronously, returns the request thread. """ - # verify the required parameter 'order_id' is set - if order_id is None: - raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") all_params = ['order_id'] all_params.append('callback') @@ -307,6 +307,10 @@ class StoreApi(object): params[key] = val del params['kwargs'] + # verify the required parameter 'order_id' is set + if ('order_id' not in params) or (params['order_id'] is None): + raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") + resource_path = '/store/order/{orderId}'.replace('{format}', 'json') method = 'DELETE' diff --git a/samples/client/petstore/python/swagger_client/apis/user_api.py b/samples/client/petstore/python/swagger_client/apis/user_api.py index aa35e6db53a..4394941b1d5 100644 --- a/samples/client/petstore/python/swagger_client/apis/user_api.py +++ b/samples/client/petstore/python/swagger_client/apis/user_api.py @@ -79,6 +79,7 @@ class UserApi(object): params[key] = val del params['kwargs'] + resource_path = '/user'.replace('{format}', 'json') method = 'POST' @@ -154,6 +155,7 @@ class UserApi(object): params[key] = val del params['kwargs'] + resource_path = '/user/createWithArray'.replace('{format}', 'json') method = 'POST' @@ -229,6 +231,7 @@ class UserApi(object): params[key] = val del params['kwargs'] + resource_path = '/user/createWithList'.replace('{format}', 'json') method = 'POST' @@ -305,6 +308,7 @@ class UserApi(object): params[key] = val del params['kwargs'] + resource_path = '/user/login'.replace('{format}', 'json') method = 'GET' @@ -381,6 +385,7 @@ class UserApi(object): params[key] = val del params['kwargs'] + resource_path = '/user/logout'.replace('{format}', 'json') method = 'GET' @@ -440,9 +445,6 @@ class UserApi(object): If the method is called asynchronously, returns the request thread. """ - # verify the required parameter 'username' is set - if username is None: - raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`") all_params = ['username'] all_params.append('callback') @@ -457,6 +459,10 @@ class UserApi(object): params[key] = val del params['kwargs'] + # verify the required parameter 'username' is set + if ('username' not in params) or (params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`") + resource_path = '/user/{username}'.replace('{format}', 'json') method = 'GET' @@ -519,9 +525,6 @@ class UserApi(object): If the method is called asynchronously, returns the request thread. """ - # verify the required parameter 'username' is set - if username is None: - raise ValueError("Missing the required parameter `username` when calling `update_user`") all_params = ['username', 'body'] all_params.append('callback') @@ -536,6 +539,10 @@ class UserApi(object): params[key] = val del params['kwargs'] + # verify the required parameter 'username' is set + if ('username' not in params) or (params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `update_user`") + resource_path = '/user/{username}'.replace('{format}', 'json') method = 'PUT' @@ -599,9 +606,6 @@ class UserApi(object): If the method is called asynchronously, returns the request thread. """ - # verify the required parameter 'username' is set - if username is None: - raise ValueError("Missing the required parameter `username` when calling `delete_user`") all_params = ['username'] all_params.append('callback') @@ -616,6 +620,10 @@ class UserApi(object): params[key] = val del params['kwargs'] + # verify the required parameter 'username' is set + if ('username' not in params) or (params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `delete_user`") + resource_path = '/user/{username}'.replace('{format}', 'json') method = 'DELETE'