Skip to content

Commit

Permalink
update nodejs express server samples
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 committed Feb 22, 2025
1 parent f83b049 commit cea3c5b
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Use this file as a starting point for your project's .eslintrc.
// Copy this file, and add rule overrides as needed.
{
"extends": "airbnb",
"extends": "airbnb-base",
"rules": {
"no-console": "off"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.eslintrc.json
README.md
api/openapi.yaml
config.js
controllers/Controller.js
controllers/PetController.js
controllers/StoreController.js
controllers/UserController.js
controllers/index.js
expressServer.js
index.js
logger.js
package.json
services/PetService.js
services/Service.js
services/StoreService.js
services/UserService.js
services/index.js
utils/openapiRouter.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.0-SNAPSHOT
7.12.0-SNAPSHOT
45 changes: 26 additions & 19 deletions samples/server/petstore/nodejs-express-server/api/openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: 3.0.1
info:
description: This is a sample server Petstore server. For this sample, you can use
the api key `special-key` to test the authorization filters.
description: "This is a sample server Petstore server. For this sample, you can\
\ use the api key `special-key` to test the authorization filters."
license:
name: Apache-2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
Expand Down Expand Up @@ -122,8 +122,8 @@ paths:
/pet/findByTags:
get:
deprecated: true
description: Multiple tags can be provided with comma separated strings. Use
tag1, tag2, tag3 for testing.
description: "Multiple tags can be provided with comma separated strings. Use\
\ tag1, tag2, tag3 for testing."
operationId: findPetsByTags
parameters:
- description: Tags to filter by
Expand Down Expand Up @@ -235,13 +235,7 @@ paths:
content:
application/x-www-form-urlencoded:
schema:
properties:
name:
description: Updated name of the pet
type: string
status:
description: Updated status of the pet
type: string
$ref: '#/components/schemas/updatePetWithForm_request'
responses:
"405":
content: {}
Expand Down Expand Up @@ -269,14 +263,7 @@ paths:
content:
multipart/form-data:
schema:
properties:
additionalMetadata:
description: Additional data to pass to server
type: string
file:
description: file to upload
format: binary
type: string
$ref: '#/components/schemas/uploadFile_request'
responses:
"200":
content:
Expand Down Expand Up @@ -767,6 +754,25 @@ components:
type: string
title: An uploaded response
type: object
updatePetWithForm_request:
properties:
name:
description: Updated name of the pet
type: string
status:
description: Updated status of the pet
type: string
type: object
uploadFile_request:
properties:
additionalMetadata:
description: Additional data to pass to server
type: string
file:
description: file to upload
format: binary
type: string
type: object
securitySchemes:
petstore_auth:
flows:
Expand All @@ -780,3 +786,4 @@ components:
in: header
name: api_key
type: apiKey
x-original-swagger-version: "2.0"
6 changes: 3 additions & 3 deletions samples/server/petstore/nodejs-express-server/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ const path = require('path');

const config = {
ROOT_DIR: __dirname,
URL_PORT: 3000,
URL_PATH: 'http://localhost',
BASE_VERSION: 'v2',
URL_PORT: 8080,
URL_PATH: 'http://petstore.swagger.io',
BASE_VERSION: '/v2',
CONTROLLER_DIRECTORY: path.join(__dirname, 'controllers'),
PROJECT_DIR: __dirname,
};
Expand Down
1 change: 0 additions & 1 deletion samples/server/petstore/nodejs-express-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"winston": "^3.2.1"
},
"devDependencies": {
"axios": "^0.19.0",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"eslint": "^5.16.0",
Expand Down

0 comments on commit cea3c5b

Please # to comment.