Skip to content

Commit c3a5b23

Browse files
authored
Merge pull request #10551 from swagger-api/nodejs-sample-update
updated samples
2 parents edafb98 + f8d71c1 commit c3a5b23

File tree

22 files changed

+554
-2443
lines changed

22 files changed

+554
-2443
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.21-SNAPSHOT
1+
3.0.24-SNAPSHOT

samples/server/petstore/nodejs-petstore-mixed/api/openapi.yaml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ paths:
105105
type: array
106106
items:
107107
type: string
108-
default: available
109108
enum:
110109
- available
111110
- pending
112111
- sold
112+
default: available
113113
responses:
114114
"200":
115115
description: successful operation
@@ -713,10 +713,10 @@ paths:
713713
type: array
714714
items:
715715
type: string
716-
default: $
717716
enum:
718717
- '>'
719718
- $
719+
default: $
720720
- name: enum_header_string
721721
in: header
722722
description: Header parameter enum test (string)
@@ -725,11 +725,11 @@ paths:
725725
explode: false
726726
schema:
727727
type: string
728-
default: -efg
729728
enum:
730729
- _abc
731730
- -efg
732731
- (xyz)
732+
default: -efg
733733
- name: enum_query_string_array
734734
in: query
735735
description: Query parameter enum test (string array)
@@ -740,10 +740,10 @@ paths:
740740
type: array
741741
items:
742742
type: string
743-
default: $
744743
enum:
745744
- '>'
746745
- $
746+
default: $
747747
- name: enum_query_string
748748
in: query
749749
description: Query parameter enum test (string)
@@ -752,11 +752,11 @@ paths:
752752
explode: true
753753
schema:
754754
type: string
755-
default: -efg
756755
enum:
757756
- _abc
758757
- -efg
759758
- (xyz)
759+
default: -efg
760760
- name: enum_query_integer
761761
in: query
762762
description: Query parameter enum test (double)
@@ -1378,6 +1378,15 @@ components:
13781378
category: test-category-name
13791379
xml:
13801380
name: Category
1381+
UserWrapper:
1382+
type: object
1383+
properties:
1384+
users:
1385+
$ref: '#/components/schemas/Users'
1386+
Users:
1387+
type: array
1388+
items:
1389+
$ref: '#/components/schemas/User'
13811390
User:
13821391
type: object
13831392
properties:
@@ -1508,11 +1517,11 @@ components:
15081517
name: Name
15091518
EnumClass:
15101519
type: string
1511-
default: -efg
15121520
enum:
15131521
- _abc
15141522
- -efg
15151523
- (xyz)
1524+
default: -efg
15161525
List:
15171526
type: object
15181527
properties:
@@ -2243,18 +2252,18 @@ components:
22432252
description: Form parameter enum test (string array)
22442253
items:
22452254
type: string
2246-
default: $
22472255
enum:
22482256
- '>'
22492257
- $
2258+
default: $
22502259
enum_form_string:
22512260
type: string
22522261
description: Form parameter enum test (string)
2253-
default: -efg
22542262
enum:
22552263
- _abc
22562264
- -efg
22572265
- (xyz)
2266+
default: -efg
22582267
enum_query_double:
22592268
type: number
22602269
description: Query parameter enum test (double)

samples/server/petstore/nodejs-petstore-mixed/controllers/Animal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ module.exports.updateAnimal = function updateAnimal (req, res, next, body) {
4343
});
4444
};
4545

46-
module.exports.updateAnimalWithForm = function updateAnimalWithForm (req, res, next, name, status, animalId) {
47-
Animal.updateAnimalWithForm(name, status, animalId)
46+
module.exports.updateAnimalWithForm = function updateAnimalWithForm (req, res, next, animalId) {
47+
Animal.updateAnimalWithForm(animalId)
4848
.then(function (response) {
4949
utils.writeJson(res, response);
5050
})

samples/server/petstore/nodejs-petstore-mixed/controllers/Dog.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ module.exports.updateDog = function updateDog (req, res, next, body) {
4343
});
4444
};
4545

46-
module.exports.updateDogWithForm = function updateDogWithForm (req, res, next, name, status, dogId) {
47-
Dog.updateDogWithForm(name, status, dogId)
46+
module.exports.updateDogWithForm = function updateDogWithForm (req, res, next, dogId) {
47+
Dog.updateDogWithForm(dogId)
4848
.then(function (response) {
4949
utils.writeJson(res, response);
5050
})

samples/server/petstore/nodejs-petstore-mixed/controllers/Pet.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ module.exports.updatePet = function updatePet (req, res, next, body) {
9393
});
9494
};
9595

96-
module.exports.updatePetWithForm = function updatePetWithForm (req, res, next, name, status, petId) {
97-
Pet.updatePetWithForm(name, status, petId)
96+
module.exports.updatePetWithForm = function updatePetWithForm (req, res, next, petId) {
97+
Pet.updatePetWithForm(petId)
9898
.then(function (response) {
9999
utils.writeJson(res, response);
100100
})
@@ -103,8 +103,8 @@ module.exports.updatePetWithForm = function updatePetWithForm (req, res, next, n
103103
});
104104
};
105105

106-
module.exports.uploadFile = function uploadFile (req, res, next, additionalMetadata, file, petId) {
107-
Pet.uploadFile(additionalMetadata, file, petId)
106+
module.exports.uploadFile = function uploadFile (req, res, next, petId) {
107+
Pet.uploadFile(petId)
108108
.then(function (response) {
109109
utils.writeJson(res, response);
110110
})

samples/server/petstore/nodejs-petstore-mixed/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ var serverPort = 8080;
88

99
// swaggerRouter configuration
1010
var options = {
11-
controllers: path.join(__dirname, './controllers')
11+
routing: {
12+
controllers: path.join(__dirname, './controllers')
13+
},
1214
};
1315

1416
var expressAppConfig = oas3Tools.expressAppConfig(path.join(__dirname, 'api/openapi.yaml'), options);
15-
expressAppConfig.addValidator();
1617
var app = expressAppConfig.getApp();
1718

1819
// Initialize the Swagger middleware

0 commit comments

Comments
 (0)