forked from loafle/openapi-generator-original
Update all the samples.
(except clojure + scalatra, because those are broken, will fixed with later master merge.)
This commit is contained in:
@@ -2,37 +2,43 @@
|
||||
|
||||
exports.deleteOrder = function(args, res, next) {
|
||||
/**
|
||||
* parameters expected in the args:
|
||||
* orderId (String)
|
||||
**/
|
||||
// no response value expected for this operation
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
*
|
||||
* orderId String ID of the order that needs to be deleted
|
||||
* no response value expected for this operation
|
||||
**/
|
||||
res.end();
|
||||
}
|
||||
|
||||
exports.getInventory = function(args, res, next) {
|
||||
/**
|
||||
* parameters expected in the args:
|
||||
**/
|
||||
var examples = {};
|
||||
* Returns pet inventories by status
|
||||
* Returns a map of status codes to quantities
|
||||
*
|
||||
* returns Map
|
||||
**/
|
||||
var examples = {};
|
||||
examples['application/json'] = {
|
||||
"key" : 123
|
||||
};
|
||||
if(Object.keys(examples).length > 0) {
|
||||
if (Object.keys(examples).length > 0) {
|
||||
res.setHeader('Content-Type', 'application/json');
|
||||
res.end(JSON.stringify(examples[Object.keys(examples)[0]] || {}, null, 2));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
res.end();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.getOrderById = function(args, res, next) {
|
||||
/**
|
||||
* parameters expected in the args:
|
||||
* orderId (Long)
|
||||
**/
|
||||
var examples = {};
|
||||
* Find purchase order by ID
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
*
|
||||
* orderId Long ID of pet that needs to be fetched
|
||||
* returns Order
|
||||
**/
|
||||
var examples = {};
|
||||
examples['application/json'] = {
|
||||
"petId" : 123456789,
|
||||
"quantity" : 123,
|
||||
@@ -41,22 +47,23 @@ exports.getOrderById = function(args, res, next) {
|
||||
"complete" : true,
|
||||
"status" : "aeiou"
|
||||
};
|
||||
if(Object.keys(examples).length > 0) {
|
||||
if (Object.keys(examples).length > 0) {
|
||||
res.setHeader('Content-Type', 'application/json');
|
||||
res.end(JSON.stringify(examples[Object.keys(examples)[0]] || {}, null, 2));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
res.end();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.placeOrder = function(args, res, next) {
|
||||
/**
|
||||
* parameters expected in the args:
|
||||
* body (Order)
|
||||
**/
|
||||
var examples = {};
|
||||
* Place an order for a pet
|
||||
*
|
||||
*
|
||||
* body Order order placed for purchasing the pet
|
||||
* returns Order
|
||||
**/
|
||||
var examples = {};
|
||||
examples['application/json'] = {
|
||||
"petId" : 123456789,
|
||||
"quantity" : 123,
|
||||
@@ -65,13 +72,11 @@ exports.placeOrder = function(args, res, next) {
|
||||
"complete" : true,
|
||||
"status" : "aeiou"
|
||||
};
|
||||
if(Object.keys(examples).length > 0) {
|
||||
if (Object.keys(examples).length > 0) {
|
||||
res.setHeader('Content-Type', 'application/json');
|
||||
res.end(JSON.stringify(examples[Object.keys(examples)[0]] || {}, null, 2));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
res.end();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user