Skip to content

Commit cea3c5b

Browse files
committed
update nodejs express server samples
1 parent f83b049 commit cea3c5b

File tree

6 files changed

+50
-25
lines changed

6 files changed

+50
-25
lines changed

samples/server/petstore/nodejs-express-server/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Use this file as a starting point for your project's .eslintrc.
22
// Copy this file, and add rule overrides as needed.
33
{
4-
"extends": "airbnb",
4+
"extends": "airbnb-base",
55
"rules": {
66
"no-console": "off"
77
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.eslintrc.json
2+
README.md
3+
api/openapi.yaml
4+
config.js
5+
controllers/Controller.js
6+
controllers/PetController.js
7+
controllers/StoreController.js
8+
controllers/UserController.js
9+
controllers/index.js
10+
expressServer.js
11+
index.js
12+
logger.js
13+
package.json
14+
services/PetService.js
15+
services/Service.js
16+
services/StoreService.js
17+
services/UserService.js
18+
services/index.js
19+
utils/openapiRouter.js
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.0.0-SNAPSHOT
1+
7.12.0-SNAPSHOT

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

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
openapi: 3.0.1
22
info:
3-
description: This is a sample server Petstore server. For this sample, you can use
4-
the api key `special-key` to test the authorization filters.
3+
description: "This is a sample server Petstore server. For this sample, you can\
4+
\ use the api key `special-key` to test the authorization filters."
55
license:
66
name: Apache-2.0
77
url: https://www.apache.org/licenses/LICENSE-2.0.html
@@ -122,8 +122,8 @@ paths:
122122
/pet/findByTags:
123123
get:
124124
deprecated: true
125-
description: Multiple tags can be provided with comma separated strings. Use
126-
tag1, tag2, tag3 for testing.
125+
description: "Multiple tags can be provided with comma separated strings. Use\
126+
\ tag1, tag2, tag3 for testing."
127127
operationId: findPetsByTags
128128
parameters:
129129
- description: Tags to filter by
@@ -235,13 +235,7 @@ paths:
235235
content:
236236
application/x-www-form-urlencoded:
237237
schema:
238-
properties:
239-
name:
240-
description: Updated name of the pet
241-
type: string
242-
status:
243-
description: Updated status of the pet
244-
type: string
238+
$ref: '#/components/schemas/updatePetWithForm_request'
245239
responses:
246240
"405":
247241
content: {}
@@ -269,14 +263,7 @@ paths:
269263
content:
270264
multipart/form-data:
271265
schema:
272-
properties:
273-
additionalMetadata:
274-
description: Additional data to pass to server
275-
type: string
276-
file:
277-
description: file to upload
278-
format: binary
279-
type: string
266+
$ref: '#/components/schemas/uploadFile_request'
280267
responses:
281268
"200":
282269
content:
@@ -767,6 +754,25 @@ components:
767754
type: string
768755
title: An uploaded response
769756
type: object
757+
updatePetWithForm_request:
758+
properties:
759+
name:
760+
description: Updated name of the pet
761+
type: string
762+
status:
763+
description: Updated status of the pet
764+
type: string
765+
type: object
766+
uploadFile_request:
767+
properties:
768+
additionalMetadata:
769+
description: Additional data to pass to server
770+
type: string
771+
file:
772+
description: file to upload
773+
format: binary
774+
type: string
775+
type: object
770776
securitySchemes:
771777
petstore_auth:
772778
flows:
@@ -780,3 +786,4 @@ components:
780786
in: header
781787
name: api_key
782788
type: apiKey
789+
x-original-swagger-version: "2.0"

samples/server/petstore/nodejs-express-server/config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ const path = require('path');
22

33
const config = {
44
ROOT_DIR: __dirname,
5-
URL_PORT: 3000,
6-
URL_PATH: 'http://localhost',
7-
BASE_VERSION: 'v2',
5+
URL_PORT: 8080,
6+
URL_PATH: 'http://petstore.swagger.io',
7+
BASE_VERSION: '/v2',
88
CONTROLLER_DIRECTORY: path.join(__dirname, 'controllers'),
99
PROJECT_DIR: __dirname,
1010
};

samples/server/petstore/nodejs-express-server/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"winston": "^3.2.1"
2828
},
2929
"devDependencies": {
30-
"axios": "^0.19.0",
3130
"chai": "^4.2.0",
3231
"chai-as-promised": "^7.1.1",
3332
"eslint": "^5.16.0",

0 commit comments

Comments
 (0)