forked from loafle/openapi-generator-original
add back summary and description to nodejs swagger.json
This commit is contained in:
parent
4143e28637
commit
1f35f58841
@ -15,17 +15,17 @@
|
|||||||
{{#operation}}
|
{{#operation}}
|
||||||
"{{{path}}}": {
|
"{{{path}}}": {
|
||||||
"{{httpMethod}}": {
|
"{{httpMethod}}": {
|
||||||
|
"summary": "{{summary}}",
|
||||||
|
"description":"{{notes}}",
|
||||||
"x-swagger-router-controller": "{{classname}}",
|
"x-swagger-router-controller": "{{classname}}",
|
||||||
"tags": ["{{baseName}}"],
|
"tags": ["{{baseName}}"],
|
||||||
"operationId": "{{operationId}}",{{#hasParams}}
|
"operationId": "{{operationId}}",{{#hasParams}}
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{{#allParams}}
|
{{#allParams}}{{{jsonSchema}}}{{#hasMore}},{{/hasMore}}
|
||||||
{{{jsonSchema}}}{{#hasMore}},{{/hasMore}}
|
|
||||||
{{/allParams}}
|
{{/allParams}}
|
||||||
],{{/hasParams}}
|
],{{/hasParams}}
|
||||||
"responses": {
|
"responses": {
|
||||||
{{#responses}}
|
{{#responses}}"{{code}}": {{{jsonSchema}}}
|
||||||
"{{code}}": {{{jsonSchema}}}
|
|
||||||
{{#hasMore}},{{/hasMore}}
|
{{#hasMore}},{{/hasMore}}
|
||||||
{{/responses}}
|
{{/responses}}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -6,13 +6,13 @@ var url = require('url');
|
|||||||
var Pet = require('./PetService');
|
var Pet = require('./PetService');
|
||||||
|
|
||||||
|
|
||||||
module.exports.updatePet = function updatePet(req, res, next) {
|
module.exports.updatePet = function updatePet (req, res, next) {
|
||||||
var body = req.swagger.params['body'].value;
|
var body = req.swagger.params['body'].value;
|
||||||
|
|
||||||
|
|
||||||
var result = Pet.updatePet(body);
|
var result = Pet.updatePet(body);
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
@ -20,13 +20,13 @@ module.exports.updatePet = function updatePet(req, res, next) {
|
|||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.addPet = function addPet(req, res, next) {
|
module.exports.addPet = function addPet (req, res, next) {
|
||||||
var body = req.swagger.params['body'].value;
|
var body = req.swagger.params['body'].value;
|
||||||
|
|
||||||
|
|
||||||
var result = Pet.addPet(body);
|
var result = Pet.addPet(body);
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
@ -34,13 +34,13 @@ module.exports.addPet = function addPet(req, res, next) {
|
|||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.findPetsByStatus = function findPetsByStatus(req, res, next) {
|
module.exports.findPetsByStatus = function findPetsByStatus (req, res, next) {
|
||||||
var status = req.swagger.params['status'].value;
|
var status = req.swagger.params['status'].value;
|
||||||
|
|
||||||
|
|
||||||
var result = Pet.findPetsByStatus(status);
|
var result = Pet.findPetsByStatus(status);
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
@ -48,13 +48,13 @@ module.exports.findPetsByStatus = function findPetsByStatus(req, res, next) {
|
|||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.findPetsByTags = function findPetsByTags(req, res, next) {
|
module.exports.findPetsByTags = function findPetsByTags (req, res, next) {
|
||||||
var tags = req.swagger.params['tags'].value;
|
var tags = req.swagger.params['tags'].value;
|
||||||
|
|
||||||
|
|
||||||
var result = Pet.findPetsByTags(tags);
|
var result = Pet.findPetsByTags(tags);
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
@ -62,13 +62,13 @@ module.exports.findPetsByTags = function findPetsByTags(req, res, next) {
|
|||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.getPetById = function getPetById(req, res, next) {
|
module.exports.getPetById = function getPetById (req, res, next) {
|
||||||
var petId = req.swagger.params['petId'].value;
|
var petId = req.swagger.params['petId'].value;
|
||||||
|
|
||||||
|
|
||||||
var result = Pet.getPetById(petId);
|
var result = Pet.getPetById(petId);
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ module.exports.getPetById = function getPetById(req, res, next) {
|
|||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.updatePetWithForm = function updatePetWithForm(req, res, next) {
|
module.exports.updatePetWithForm = function updatePetWithForm (req, res, next) {
|
||||||
var petId = req.swagger.params['petId'].value;
|
var petId = req.swagger.params['petId'].value;
|
||||||
var name = req.swagger.params['name'].value;
|
var name = req.swagger.params['name'].value;
|
||||||
var status = req.swagger.params['status'].value;
|
var status = req.swagger.params['status'].value;
|
||||||
@ -84,7 +84,7 @@ module.exports.updatePetWithForm = function updatePetWithForm(req, res, next) {
|
|||||||
|
|
||||||
var result = Pet.updatePetWithForm(petId, name, status);
|
var result = Pet.updatePetWithForm(petId, name, status);
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
@ -92,14 +92,14 @@ module.exports.updatePetWithForm = function updatePetWithForm(req, res, next) {
|
|||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.deletePet = function deletePet(req, res, next) {
|
module.exports.deletePet = function deletePet (req, res, next) {
|
||||||
var api_key = req.swagger.params['api_key'].value;
|
var apiKey = req.swagger.params['api_key'].value;
|
||||||
var petId = req.swagger.params['petId'].value;
|
var petId = req.swagger.params['petId'].value;
|
||||||
|
|
||||||
|
|
||||||
var result = Pet.deletePet(api_key, petId);
|
var result = Pet.deletePet(apiKey, petId);
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
@ -107,7 +107,7 @@ module.exports.deletePet = function deletePet(req, res, next) {
|
|||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.uploadFile = function uploadFile(req, res, next) {
|
module.exports.uploadFile = function uploadFile (req, res, next) {
|
||||||
var petId = req.swagger.params['petId'].value;
|
var petId = req.swagger.params['petId'].value;
|
||||||
var additionalMetadata = req.swagger.params['additionalMetadata'].value;
|
var additionalMetadata = req.swagger.params['additionalMetadata'].value;
|
||||||
var file = req.swagger.params['file'].value;
|
var file = req.swagger.params['file'].value;
|
||||||
@ -115,7 +115,7 @@ module.exports.uploadFile = function uploadFile(req, res, next) {
|
|||||||
|
|
||||||
var result = Pet.uploadFile(petId, additionalMetadata, file);
|
var result = Pet.uploadFile(petId, additionalMetadata, file);
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
|
@ -1,104 +1,112 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
exports.updatePet = function (body) {
|
exports.updatePet = function(body) {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
exports.addPet = function (body) {
|
exports.addPet = function(body) {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
exports.findPetsByStatus = function (status) {
|
exports.findPetsByStatus = function(status) {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
examples['application/json'] = [{
|
examples['application/json'] = [ {
|
||||||
"tags": [{
|
"tags" : [ {
|
||||||
"id": 123456789,
|
"id" : 123456789,
|
||||||
"name": "aeiou"
|
"name" : "aeiou"
|
||||||
}],
|
} ],
|
||||||
"id": 123456789,
|
"id" : 123456789,
|
||||||
"category": {
|
"category" : {
|
||||||
"id": 123456789,
|
"id" : 123456789,
|
||||||
"name": "aeiou"
|
"name" : "aeiou"
|
||||||
},
|
},
|
||||||
"status": "aeiou",
|
"status" : "aeiou",
|
||||||
"name": "doggie",
|
"name" : "doggie",
|
||||||
"photoUrls": ["aeiou"]
|
"photoUrls" : [ "aeiou" ]
|
||||||
}];
|
} ];
|
||||||
|
|
||||||
|
|
||||||
if (Object.keys(examples).length > 0)
|
|
||||||
|
if(Object.keys(examples).length > 0)
|
||||||
return examples[Object.keys(examples)[0]];
|
return examples[Object.keys(examples)[0]];
|
||||||
|
|
||||||
}
|
}
|
||||||
exports.findPetsByTags = function (tags) {
|
exports.findPetsByTags = function(tags) {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
examples['application/json'] = [{
|
examples['application/json'] = [ {
|
||||||
"tags": [{
|
"tags" : [ {
|
||||||
"id": 123456789,
|
"id" : 123456789,
|
||||||
"name": "aeiou"
|
"name" : "aeiou"
|
||||||
}],
|
} ],
|
||||||
"id": 123456789,
|
"id" : 123456789,
|
||||||
"category": {
|
"category" : {
|
||||||
"id": 123456789,
|
"id" : 123456789,
|
||||||
"name": "aeiou"
|
"name" : "aeiou"
|
||||||
},
|
},
|
||||||
"status": "aeiou",
|
"status" : "aeiou",
|
||||||
"name": "doggie",
|
"name" : "doggie",
|
||||||
"photoUrls": ["aeiou"]
|
"photoUrls" : [ "aeiou" ]
|
||||||
}];
|
} ];
|
||||||
|
|
||||||
|
|
||||||
if (Object.keys(examples).length > 0)
|
|
||||||
|
if(Object.keys(examples).length > 0)
|
||||||
return examples[Object.keys(examples)[0]];
|
return examples[Object.keys(examples)[0]];
|
||||||
|
|
||||||
}
|
}
|
||||||
exports.getPetById = function (petId) {
|
exports.getPetById = function(petId) {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
examples['application/json'] = {
|
examples['application/json'] = {
|
||||||
"tags": [{
|
"tags" : [ {
|
||||||
"id": 123456789,
|
"id" : 123456789,
|
||||||
"name": "aeiou"
|
"name" : "aeiou"
|
||||||
}],
|
} ],
|
||||||
"id": 123456789,
|
"id" : 123456789,
|
||||||
"category": {
|
"category" : {
|
||||||
"id": 123456789,
|
"id" : 123456789,
|
||||||
"name": "aeiou"
|
"name" : "aeiou"
|
||||||
},
|
},
|
||||||
"status": "aeiou",
|
"status" : "aeiou",
|
||||||
"name": "doggie",
|
"name" : "doggie",
|
||||||
"photoUrls": ["aeiou"]
|
"photoUrls" : [ "aeiou" ]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
if (Object.keys(examples).length > 0)
|
|
||||||
|
if(Object.keys(examples).length > 0)
|
||||||
return examples[Object.keys(examples)[0]];
|
return examples[Object.keys(examples)[0]];
|
||||||
|
|
||||||
}
|
}
|
||||||
exports.updatePetWithForm = function (petId, name, status) {
|
exports.updatePetWithForm = function(petId, name, status) {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
exports.deletePet = function (api_key, petId) {
|
exports.deletePet = function(apiKey, petId) {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
exports.uploadFile = function (petId, additionalMetadata, file) {
|
exports.uploadFile = function(petId, additionalMetadata, file) {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,12 @@ var url = require('url');
|
|||||||
var Store = require('./StoreService');
|
var Store = require('./StoreService');
|
||||||
|
|
||||||
|
|
||||||
module.exports.getInventory = function getInventory(req, res, next) {
|
module.exports.getInventory = function getInventory (req, res, next) {
|
||||||
|
|
||||||
|
|
||||||
var result = Store.getInventory();
|
var result = Store.getInventory();
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
@ -19,13 +19,13 @@ module.exports.getInventory = function getInventory(req, res, next) {
|
|||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.placeOrder = function placeOrder(req, res, next) {
|
module.exports.placeOrder = function placeOrder (req, res, next) {
|
||||||
var body = req.swagger.params['body'].value;
|
var body = req.swagger.params['body'].value;
|
||||||
|
|
||||||
|
|
||||||
var result = Store.placeOrder(body);
|
var result = Store.placeOrder(body);
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
@ -33,13 +33,13 @@ module.exports.placeOrder = function placeOrder(req, res, next) {
|
|||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.getOrderById = function getOrderById(req, res, next) {
|
module.exports.getOrderById = function getOrderById (req, res, next) {
|
||||||
var orderId = req.swagger.params['orderId'].value;
|
var orderId = req.swagger.params['orderId'].value;
|
||||||
|
|
||||||
|
|
||||||
var result = Store.getOrderById(orderId);
|
var result = Store.getOrderById(orderId);
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
@ -47,13 +47,13 @@ module.exports.getOrderById = function getOrderById(req, res, next) {
|
|||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.deleteOrder = function deleteOrder(req, res, next) {
|
module.exports.deleteOrder = function deleteOrder (req, res, next) {
|
||||||
var orderId = req.swagger.params['orderId'].value;
|
var orderId = req.swagger.params['orderId'].value;
|
||||||
|
|
||||||
|
|
||||||
var result = Store.deleteOrder(orderId);
|
var result = Store.deleteOrder(orderId);
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
|
@ -1,57 +1,61 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
exports.getInventory = function () {
|
exports.getInventory = function() {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
examples['application/json'] = {
|
examples['application/json'] = {
|
||||||
"key": 123
|
"key" : 123
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
if (Object.keys(examples).length > 0)
|
|
||||||
|
if(Object.keys(examples).length > 0)
|
||||||
return examples[Object.keys(examples)[0]];
|
return examples[Object.keys(examples)[0]];
|
||||||
|
|
||||||
}
|
}
|
||||||
exports.placeOrder = function (body) {
|
exports.placeOrder = function(body) {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
examples['application/json'] = {
|
examples['application/json'] = {
|
||||||
"id": 123456789,
|
"id" : 123456789,
|
||||||
"petId": 123456789,
|
"petId" : 123456789,
|
||||||
"complete": true,
|
"complete" : true,
|
||||||
"status": "aeiou",
|
"status" : "aeiou",
|
||||||
"quantity": 123,
|
"quantity" : 123,
|
||||||
"shipDate": "2015-03-19T21:51:51.599+0000"
|
"shipDate" : "2015-07-09T06:03:19.571+0000"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
if (Object.keys(examples).length > 0)
|
|
||||||
|
if(Object.keys(examples).length > 0)
|
||||||
return examples[Object.keys(examples)[0]];
|
return examples[Object.keys(examples)[0]];
|
||||||
|
|
||||||
}
|
}
|
||||||
exports.getOrderById = function (orderId) {
|
exports.getOrderById = function(orderId) {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
examples['application/json'] = {
|
examples['application/json'] = {
|
||||||
"id": 123456789,
|
"id" : 123456789,
|
||||||
"petId": 123456789,
|
"petId" : 123456789,
|
||||||
"complete": true,
|
"complete" : true,
|
||||||
"status": "aeiou",
|
"status" : "aeiou",
|
||||||
"quantity": 123,
|
"quantity" : 123,
|
||||||
"shipDate": "2015-03-19T21:51:51.603+0000"
|
"shipDate" : "2015-07-09T06:03:19.576+0000"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
if (Object.keys(examples).length > 0)
|
|
||||||
|
if(Object.keys(examples).length > 0)
|
||||||
return examples[Object.keys(examples)[0]];
|
return examples[Object.keys(examples)[0]];
|
||||||
|
|
||||||
}
|
}
|
||||||
exports.deleteOrder = function (orderId) {
|
exports.deleteOrder = function(orderId) {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,13 +6,13 @@ var url = require('url');
|
|||||||
var User = require('./UserService');
|
var User = require('./UserService');
|
||||||
|
|
||||||
|
|
||||||
module.exports.createUser = function createUser(req, res, next) {
|
module.exports.createUser = function createUser (req, res, next) {
|
||||||
var body = req.swagger.params['body'].value;
|
var body = req.swagger.params['body'].value;
|
||||||
|
|
||||||
|
|
||||||
var result = User.createUser(body);
|
var result = User.createUser(body);
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
@ -20,13 +20,13 @@ module.exports.createUser = function createUser(req, res, next) {
|
|||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.createUsersWithArrayInput = function createUsersWithArrayInput(req, res, next) {
|
module.exports.createUsersWithArrayInput = function createUsersWithArrayInput (req, res, next) {
|
||||||
var body = req.swagger.params['body'].value;
|
var body = req.swagger.params['body'].value;
|
||||||
|
|
||||||
|
|
||||||
var result = User.createUsersWithArrayInput(body);
|
var result = User.createUsersWithArrayInput(body);
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
@ -34,13 +34,13 @@ module.exports.createUsersWithArrayInput = function createUsersWithArrayInput(re
|
|||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.createUsersWithListInput = function createUsersWithListInput(req, res, next) {
|
module.exports.createUsersWithListInput = function createUsersWithListInput (req, res, next) {
|
||||||
var body = req.swagger.params['body'].value;
|
var body = req.swagger.params['body'].value;
|
||||||
|
|
||||||
|
|
||||||
var result = User.createUsersWithListInput(body);
|
var result = User.createUsersWithListInput(body);
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
@ -48,14 +48,14 @@ module.exports.createUsersWithListInput = function createUsersWithListInput(req,
|
|||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.loginUser = function loginUser(req, res, next) {
|
module.exports.loginUser = function loginUser (req, res, next) {
|
||||||
var username = req.swagger.params['username'].value;
|
var username = req.swagger.params['username'].value;
|
||||||
var password = req.swagger.params['password'].value;
|
var password = req.swagger.params['password'].value;
|
||||||
|
|
||||||
|
|
||||||
var result = User.loginUser(username, password);
|
var result = User.loginUser(username, password);
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
@ -63,12 +63,12 @@ module.exports.loginUser = function loginUser(req, res, next) {
|
|||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.logoutUser = function logoutUser(req, res, next) {
|
module.exports.logoutUser = function logoutUser (req, res, next) {
|
||||||
|
|
||||||
|
|
||||||
var result = User.logoutUser();
|
var result = User.logoutUser();
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
@ -76,13 +76,13 @@ module.exports.logoutUser = function logoutUser(req, res, next) {
|
|||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.getUserByName = function getUserByName(req, res, next) {
|
module.exports.getUserByName = function getUserByName (req, res, next) {
|
||||||
var username = req.swagger.params['username'].value;
|
var username = req.swagger.params['username'].value;
|
||||||
|
|
||||||
|
|
||||||
var result = User.getUserByName(username);
|
var result = User.getUserByName(username);
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
@ -90,14 +90,14 @@ module.exports.getUserByName = function getUserByName(req, res, next) {
|
|||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.updateUser = function updateUser(req, res, next) {
|
module.exports.updateUser = function updateUser (req, res, next) {
|
||||||
var username = req.swagger.params['username'].value;
|
var username = req.swagger.params['username'].value;
|
||||||
var body = req.swagger.params['body'].value;
|
var body = req.swagger.params['body'].value;
|
||||||
|
|
||||||
|
|
||||||
var result = User.updateUser(username, body);
|
var result = User.updateUser(username, body);
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
@ -105,13 +105,13 @@ module.exports.updateUser = function updateUser(req, res, next) {
|
|||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.deleteUser = function deleteUser(req, res, next) {
|
module.exports.deleteUser = function deleteUser (req, res, next) {
|
||||||
var username = req.swagger.params['username'].value;
|
var username = req.swagger.params['username'].value;
|
||||||
|
|
||||||
|
|
||||||
var result = User.deleteUser(username);
|
var result = User.deleteUser(username);
|
||||||
|
|
||||||
if (typeof result !== 'undefined') {
|
if(typeof result !== 'undefined') {
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
res.end(JSON.stringify(result || {}, null, 2));
|
res.end(JSON.stringify(result || {}, null, 2));
|
||||||
}
|
}
|
||||||
|
@ -1,69 +1,77 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
exports.createUser = function (body) {
|
exports.createUser = function(body) {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
exports.createUsersWithArrayInput = function (body) {
|
exports.createUsersWithArrayInput = function(body) {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
exports.createUsersWithListInput = function (body) {
|
exports.createUsersWithListInput = function(body) {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
exports.loginUser = function (username, password) {
|
exports.loginUser = function(username, password) {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
examples['application/json'] = "aeiou";
|
examples['application/json'] = "aeiou";
|
||||||
|
|
||||||
|
|
||||||
if (Object.keys(examples).length > 0)
|
|
||||||
|
if(Object.keys(examples).length > 0)
|
||||||
return examples[Object.keys(examples)[0]];
|
return examples[Object.keys(examples)[0]];
|
||||||
|
|
||||||
}
|
}
|
||||||
exports.logoutUser = function () {
|
exports.logoutUser = function() {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
exports.getUserByName = function (username) {
|
exports.getUserByName = function(username) {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
examples['application/json'] = {
|
examples['application/json'] = {
|
||||||
"id": 123456789,
|
"id" : 1,
|
||||||
"lastName": "aeiou",
|
"username" : "johnp",
|
||||||
"phone": "aeiou",
|
"firstName" : "John",
|
||||||
"username": "aeiou",
|
"lastName" : "Public",
|
||||||
"email": "aeiou",
|
"email" : "johnp@swagger.io",
|
||||||
"userStatus": 123,
|
"password" : "-secret-",
|
||||||
"firstName": "aeiou",
|
"phone" : "0123456789",
|
||||||
"password": "aeiou"
|
"userStatus" : 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
if (Object.keys(examples).length > 0)
|
|
||||||
|
if(Object.keys(examples).length > 0)
|
||||||
return examples[Object.keys(examples)[0]];
|
return examples[Object.keys(examples)[0]];
|
||||||
|
|
||||||
}
|
}
|
||||||
exports.updateUser = function (username, body) {
|
exports.updateUser = function(username, body) {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
exports.deleteUser = function (username) {
|
exports.deleteUser = function(username) {
|
||||||
|
|
||||||
var examples = {};
|
var examples = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "",
|
"name": "",
|
||||||
"version": "",
|
"version": "1.0.0",
|
||||||
"description": "This is a sample server Petstore server. You can find out more about Swagger at <a href="http://swagger.io">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key "special-key" to test the authorization filters",
|
"description": "This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"swagger"
|
"swagger"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user