Skip to content

updated samples #10551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.21-SNAPSHOT
3.0.24-SNAPSHOT
25 changes: 17 additions & 8 deletions samples/server/petstore/nodejs-petstore-mixed/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ paths:
type: array
items:
type: string
default: available
enum:
- available
- pending
- sold
default: available
responses:
"200":
description: successful operation
Expand Down Expand Up @@ -713,10 +713,10 @@ paths:
type: array
items:
type: string
default: $
enum:
- '>'
- $
default: $
- name: enum_header_string
in: header
description: Header parameter enum test (string)
Expand All @@ -725,11 +725,11 @@ paths:
explode: false
schema:
type: string
default: -efg
enum:
- _abc
- -efg
- (xyz)
default: -efg
- name: enum_query_string_array
in: query
description: Query parameter enum test (string array)
Expand All @@ -740,10 +740,10 @@ paths:
type: array
items:
type: string
default: $
enum:
- '>'
- $
default: $
- name: enum_query_string
in: query
description: Query parameter enum test (string)
Expand All @@ -752,11 +752,11 @@ paths:
explode: true
schema:
type: string
default: -efg
enum:
- _abc
- -efg
- (xyz)
default: -efg
- name: enum_query_integer
in: query
description: Query parameter enum test (double)
Expand Down Expand Up @@ -1378,6 +1378,15 @@ components:
category: test-category-name
xml:
name: Category
UserWrapper:
type: object
properties:
users:
$ref: '#/components/schemas/Users'
Users:
type: array
items:
$ref: '#/components/schemas/User'
User:
type: object
properties:
Expand Down Expand Up @@ -1508,11 +1517,11 @@ components:
name: Name
EnumClass:
type: string
default: -efg
enum:
- _abc
- -efg
- (xyz)
default: -efg
List:
type: object
properties:
Expand Down Expand Up @@ -2243,18 +2252,18 @@ components:
description: Form parameter enum test (string array)
items:
type: string
default: $
enum:
- '>'
- $
default: $
enum_form_string:
type: string
description: Form parameter enum test (string)
default: -efg
enum:
- _abc
- -efg
- (xyz)
default: -efg
enum_query_double:
type: number
description: Query parameter enum test (double)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ module.exports.updateAnimal = function updateAnimal (req, res, next, body) {
});
};

module.exports.updateAnimalWithForm = function updateAnimalWithForm (req, res, next, name, status, animalId) {
Animal.updateAnimalWithForm(name, status, animalId)
module.exports.updateAnimalWithForm = function updateAnimalWithForm (req, res, next, animalId) {
Animal.updateAnimalWithForm(animalId)
.then(function (response) {
utils.writeJson(res, response);
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ module.exports.updateDog = function updateDog (req, res, next, body) {
});
};

module.exports.updateDogWithForm = function updateDogWithForm (req, res, next, name, status, dogId) {
Dog.updateDogWithForm(name, status, dogId)
module.exports.updateDogWithForm = function updateDogWithForm (req, res, next, dogId) {
Dog.updateDogWithForm(dogId)
.then(function (response) {
utils.writeJson(res, response);
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ module.exports.updatePet = function updatePet (req, res, next, body) {
});
};

module.exports.updatePetWithForm = function updatePetWithForm (req, res, next, name, status, petId) {
Pet.updatePetWithForm(name, status, petId)
module.exports.updatePetWithForm = function updatePetWithForm (req, res, next, petId) {
Pet.updatePetWithForm(petId)
.then(function (response) {
utils.writeJson(res, response);
})
Expand All @@ -103,8 +103,8 @@ module.exports.updatePetWithForm = function updatePetWithForm (req, res, next, n
});
};

module.exports.uploadFile = function uploadFile (req, res, next, additionalMetadata, file, petId) {
Pet.uploadFile(additionalMetadata, file, petId)
module.exports.uploadFile = function uploadFile (req, res, next, petId) {
Pet.uploadFile(petId)
.then(function (response) {
utils.writeJson(res, response);
})
Expand Down
5 changes: 3 additions & 2 deletions samples/server/petstore/nodejs-petstore-mixed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ var serverPort = 8080;

// swaggerRouter configuration
var options = {
controllers: path.join(__dirname, './controllers')
routing: {
controllers: path.join(__dirname, './controllers')
},
};

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

// Initialize the Swagger middleware
Expand Down
Loading