[koly] generate nodejs codes

This commit is contained in:
kolyjjj 2016-05-04 17:56:02 +08:00
parent 0ce6fd7b36
commit 98a2a22abf
5 changed files with 50 additions and 50 deletions

View File

@ -587,10 +587,6 @@ paths:
description: "User not found"
x-swagger-router-controller: "User"
securityDefinitions:
api_key:
type: "apiKey"
name: "api_key"
in: "header"
petstore_auth:
type: "oauth2"
authorizationUrl: "http://petstore.swagger.io/api/oauth/dialog"
@ -598,6 +594,10 @@ securityDefinitions:
scopes:
write:pets: "modify pets in your account"
read:pets: "read your pets"
api_key:
type: "apiKey"
name: "api_key"
in: "header"
definitions:
Order:
type: "object"

View File

@ -13,7 +13,7 @@ exports.deletePet = function(args, res, next) {
/**
* parameters expected in the args:
* petId (Long)
* apiKey (String)
* api_key (String)
**/
// no response value expected for this operation
res.end();
@ -26,18 +26,18 @@ exports.findPetsByStatus = function(args, res, next) {
**/
var examples = {};
examples['application/json'] = [ {
"tags" : [ {
"id" : 123456789,
"name" : "aeiou"
} ],
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
"id" : 123456789,
"category" : {
"id" : 123456789,
"name" : "aeiou"
"name" : "aeiou",
"id" : 123456789
},
"status" : "aeiou",
"name" : "doggie",
"photoUrls" : [ "aeiou" ]
"tags" : [ {
"name" : "aeiou",
"id" : 123456789
} ],
"status" : "aeiou"
} ];
if(Object.keys(examples).length > 0) {
res.setHeader('Content-Type', 'application/json');
@ -56,18 +56,18 @@ exports.findPetsByTags = function(args, res, next) {
**/
var examples = {};
examples['application/json'] = [ {
"tags" : [ {
"id" : 123456789,
"name" : "aeiou"
} ],
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
"id" : 123456789,
"category" : {
"id" : 123456789,
"name" : "aeiou"
"name" : "aeiou",
"id" : 123456789
},
"status" : "aeiou",
"name" : "doggie",
"photoUrls" : [ "aeiou" ]
"tags" : [ {
"name" : "aeiou",
"id" : 123456789
} ],
"status" : "aeiou"
} ];
if(Object.keys(examples).length > 0) {
res.setHeader('Content-Type', 'application/json');
@ -86,18 +86,18 @@ exports.getPetById = function(args, res, next) {
**/
var examples = {};
examples['application/json'] = {
"tags" : [ {
"id" : 123456789,
"name" : "aeiou"
} ],
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
"id" : 123456789,
"category" : {
"id" : 123456789,
"name" : "aeiou"
"name" : "aeiou",
"id" : 123456789
},
"status" : "aeiou",
"name" : "doggie",
"photoUrls" : [ "aeiou" ]
"tags" : [ {
"name" : "aeiou",
"id" : 123456789
} ],
"status" : "aeiou"
};
if(Object.keys(examples).length > 0) {
res.setHeader('Content-Type', 'application/json');
@ -138,9 +138,9 @@ exports.uploadFile = function(args, res, next) {
**/
var examples = {};
examples['application/json'] = {
"message" : "aeiou",
"code" : 123,
"type" : "aeiou"
"type" : "aeiou",
"message" : "aeiou"
};
if(Object.keys(examples).length > 0) {
res.setHeader('Content-Type', 'application/json');

View File

@ -34,12 +34,12 @@ exports.getOrderById = function(args, res, next) {
**/
var examples = {};
examples['application/json'] = {
"id" : 123456789,
"petId" : 123456789,
"complete" : true,
"status" : "aeiou",
"quantity" : 123,
"shipDate" : "2000-01-23T04:56:07.000+0000"
"id" : 123456789,
"shipDate" : "2000-01-23T04:56:07.000+0000",
"complete" : true,
"status" : "aeiou"
};
if(Object.keys(examples).length > 0) {
res.setHeader('Content-Type', 'application/json');
@ -58,12 +58,12 @@ exports.placeOrder = function(args, res, next) {
**/
var examples = {};
examples['application/json'] = {
"id" : 123456789,
"petId" : 123456789,
"complete" : true,
"status" : "aeiou",
"quantity" : 123,
"shipDate" : "2000-01-23T04:56:07.000+0000"
"id" : 123456789,
"shipDate" : "2000-01-23T04:56:07.000+0000",
"complete" : true,
"status" : "aeiou"
};
if(Object.keys(examples).length > 0) {
res.setHeader('Content-Type', 'application/json');

View File

@ -43,14 +43,14 @@ exports.getUserByName = function(args, res, next) {
**/
var examples = {};
examples['application/json'] = {
"id" : 123456789,
"lastName" : "aeiou",
"phone" : "aeiou",
"username" : "aeiou",
"email" : "aeiou",
"userStatus" : 123,
"firstName" : "aeiou",
"password" : "aeiou"
"lastName" : "aeiou",
"password" : "aeiou",
"userStatus" : 123,
"phone" : "aeiou",
"id" : 123456789,
"email" : "aeiou",
"username" : "aeiou"
};
if(Object.keys(examples).length > 0) {
res.setHeader('Content-Type', 'application/json');

View File

@ -11,6 +11,6 @@
"dependencies": {
"connect": "^3.2.0",
"js-yaml": "^3.3.0",
"swagger-tools": "0.9.*"
"swagger-tools": "0.10.1"
}
}