forked from loafle/openapi-generator-original
update nodejs server sample
This commit is contained in:
@@ -3,44 +3,18 @@
|
||||
exports.deleteOrder = function(args, res, next) {
|
||||
/**
|
||||
* parameters expected in the args:
|
||||
* orderId (Long)
|
||||
* orderId (String)
|
||||
**/
|
||||
// no response value expected for this operation
|
||||
|
||||
|
||||
res.end();
|
||||
}
|
||||
|
||||
exports.getInventory = function(args, res, next) {
|
||||
/**
|
||||
* parameters expected in the args:
|
||||
**/
|
||||
|
||||
|
||||
var examples = {};
|
||||
examples['application/json'] = {
|
||||
"key" : 123
|
||||
};
|
||||
|
||||
if(Object.keys(examples).length > 0) {
|
||||
res.setHeader('Content-Type', 'application/json');
|
||||
res.end(JSON.stringify(examples[Object.keys(examples)[0]] || {}, null, 2));
|
||||
}
|
||||
else {
|
||||
res.end();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
exports.getOrderById = function(args, res, next) {
|
||||
/**
|
||||
* parameters expected in the args:
|
||||
* orderId (Long)
|
||||
* orderId (String)
|
||||
**/
|
||||
|
||||
|
||||
var examples = {};
|
||||
var examples = {};
|
||||
examples['application/json'] = {
|
||||
"id" : 123456789,
|
||||
"petId" : 123456789,
|
||||
@@ -49,7 +23,6 @@ exports.getOrderById = function(args, res, next) {
|
||||
"quantity" : 123,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+0000"
|
||||
};
|
||||
|
||||
if(Object.keys(examples).length > 0) {
|
||||
res.setHeader('Content-Type', 'application/json');
|
||||
res.end(JSON.stringify(examples[Object.keys(examples)[0]] || {}, null, 2));
|
||||
@@ -58,7 +31,6 @@ exports.getOrderById = function(args, res, next) {
|
||||
res.end();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
exports.placeOrder = function(args, res, next) {
|
||||
@@ -66,9 +38,7 @@ exports.placeOrder = function(args, res, next) {
|
||||
* parameters expected in the args:
|
||||
* body (Order)
|
||||
**/
|
||||
|
||||
|
||||
var examples = {};
|
||||
var examples = {};
|
||||
examples['application/json'] = {
|
||||
"id" : 123456789,
|
||||
"petId" : 123456789,
|
||||
@@ -77,7 +47,6 @@ exports.placeOrder = function(args, res, next) {
|
||||
"quantity" : 123,
|
||||
"shipDate" : "2000-01-23T04:56:07.000+0000"
|
||||
};
|
||||
|
||||
if(Object.keys(examples).length > 0) {
|
||||
res.setHeader('Content-Type', 'application/json');
|
||||
res.end(JSON.stringify(examples[Object.keys(examples)[0]] || {}, null, 2));
|
||||
@@ -86,6 +55,5 @@ exports.placeOrder = function(args, res, next) {
|
||||
res.end();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user