update php, nodejs, scalatra server for petstore

This commit is contained in:
wing328
2016-04-15 20:05:45 +08:00
parent 400cc9e6f9
commit c93fcc2643
23 changed files with 1197 additions and 1185 deletions

View File

@@ -12,8 +12,8 @@ exports.addPet = function(args, res, next) {
exports.deletePet = function(args, res, next) {
/**
* parameters expected in the args:
* apiKey (String)
* petId (Long)
* apiKey (String)
**/
// no response value expected for this operation
res.end();
@@ -121,7 +121,7 @@ exports.updatePet = function(args, res, next) {
exports.updatePetWithForm = function(args, res, next) {
/**
* parameters expected in the args:
* petId (String)
* petId (Long)
* name (String)
* status (String)
**/
@@ -129,3 +129,26 @@ exports.updatePetWithForm = function(args, res, next) {
res.end();
}
exports.uploadFile = function(args, res, next) {
/**
* parameters expected in the args:
* petId (Long)
* additionalMetadata (String)
* file (file)
**/
var examples = {};
examples['application/json'] = {
"message" : "aeiou",
"code" : 123,
"type" : "aeiou"
};
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();
}
}