updated listings

This commit is contained in:
Tony Tam 2014-01-21 09:39:30 -08:00
parent 1aa65bc14b
commit ffca1e2969
4 changed files with 320 additions and 139 deletions

View File

@ -6,49 +6,52 @@
"path": "/pet", "path": "/pet",
"description": "Operations about pets" "description": "Operations about pets"
}, },
{
"path": "/store",
"description": "Operations about store"
},
{ {
"path": "/user", "path": "/user",
"description": "Operations about user" "description": "Operations about user"
},
{
"path": "/store",
"description": "Operations about store"
} }
], ],
"authorizations": { "authorizations": {
"oauth2": { "oauth2": {
"type": "oauth2", "type": "oauth2",
"scopes": [ "scopes": [
"PUBLIC" {
"scope": "email",
"description": "Access to your email address"
},
{
"scope": "pets",
"description": "Access to your pets"
}
], ],
"grantTypes": { "grantTypes": {
"implicit": { "implicit": {
"loginEndpoint": { "loginEndpoint": {
"url": "http://localhost:8002/oauth/dialog" "url": "http://petstore.swagger.wordnik.com/oauth/dialog"
}, },
"tokenName": "access_code" "tokenName": "access_token"
}, },
"authorization_code": { "authorization_code": {
"tokenRequestEndpoint": { "tokenRequestEndpoint": {
"url": "http://localhost:8002/oauth/requestToken", "url": "http://petstore.swagger.wordnik.com/oauth/requestToken",
"clientIdName": "client_id", "clientIdName": "client_id",
"clientSecretName": "client_secret" "clientSecretName": "client_secret"
}, },
"tokenEndpoint": { "tokenEndpoint": {
"url": "http://localhost:8002/oauth/token", "url": "http://petstore.swagger.wordnik.com/oauth/token",
"tokenName": "access_code" "tokenName": "access_code"
} }
} }
} }
},
"apiKey": {
"type": "apiKey",
"passAs": "header"
} }
}, },
"info": { "info": {
"title": "Swagger Sample App", "title": "Swagger Sample App",
"description": "This is a sample server Petstore server. You can find out more about Swagger \n at <a href=\"http://swagger.wordnik.com\">http://swagger.wordnik.com</a> or on irc.freenode.net, #swagger.", "description": "This is a sample server Petstore server. You can find out more about Swagger \n at <a href=\"http://swagger.wordnik.com\">http://swagger.wordnik.com</a> or on irc.freenode.net, #swagger. For this sample,\n you can use the api key \"special-key\" to test the authorization filters",
"termsOfServiceUrl": "http://helloreverb.com/terms/", "termsOfServiceUrl": "http://helloreverb.com/terms/",
"contact": "apiteam@wordnik.com", "contact": "apiteam@wordnik.com",
"license": "Apache 2.0", "license": "Apache 2.0",

View File

@ -1,7 +1,7 @@
{ {
"apiVersion": "1.0.0", "apiVersion": "1.0.0",
"swaggerVersion": "1.2", "swaggerVersion": "1.2",
"basePath": "http://localhost:8002/api", "basePath": "http://petstore.swagger.wordnik.com/api",
"resourcePath": "/pet", "resourcePath": "/pet",
"produces": [ "produces": [
"application/json", "application/json",
@ -19,21 +19,17 @@
"notes": "Returns a pet based on ID", "notes": "Returns a pet based on ID",
"type": "Pet", "type": "Pet",
"nickname": "getPetById", "nickname": "getPetById",
"produces": [ "authorizations": {},
"application/json",
"application/xml"
],
"authorizations": [
"oauth2"
],
"parameters": [ "parameters": [
{ {
"name": "petId", "name": "petId",
"description": "ID of pet that needs to be fetched", "description": "ID of pet that needs to be fetched",
"required": true, "required": true,
"allowMultiple": false, "type": "integer",
"type": "string", "format": "int64",
"paramType": "path" "paramType": "path",
"minimum": "1.0",
"maximum": "100000.0"
} }
], ],
"responseMessages": [ "responseMessages": [
@ -47,18 +43,120 @@
} }
] ]
}, },
{
"method": "PATCH",
"summary": "partial updates to a pet",
"notes": "",
"type": "array",
"items": {
"$ref": "Pet"
},
"nickname": "partialUpdate",
"produces": [
"application/json",
"application/xml"
],
"consumes": [
"application/json",
"application/xml"
],
"authorizations": {
"oauth2": [
{
"scope": "test:anything",
"description": "anything"
}
]
},
"parameters": [
{
"name": "petId",
"description": "ID of pet that needs to be fetched",
"required": true,
"type": "string",
"paramType": "path"
},
{
"name": "body",
"description": "Pet object that needs to be added to the store",
"required": true,
"type": "Pet",
"paramType": "body"
}
],
"responseMessages": [
{
"code": 400,
"message": "Invalid tag value"
}
]
},
{
"method": "POST",
"summary": "Updates a pet in the store with form data",
"notes": "",
"type": "void",
"nickname": "updatePetWithForm",
"consumes": [
"application/x-www-form-urlencoded"
],
"authorizations": {
"oauth2": [
{
"scope": "test:anything",
"description": "anything"
}
]
},
"parameters": [
{
"name": "petId",
"description": "ID of pet that needs to be updated",
"required": true,
"type": "string",
"paramType": "path"
},
{
"name": "name",
"description": "Updated name of the pet",
"required": false,
"type": "string",
"paramType": "form"
},
{
"name": "status",
"description": "Updated status of the pet",
"required": false,
"type": "string",
"paramType": "form"
}
],
"responseMessages": [
{
"code": 405,
"message": "Invalid input"
}
]
},
{ {
"method": "DELETE", "method": "DELETE",
"summary": "Deletes a pet", "summary": "Deletes a pet",
"notes": "", "notes": "",
"type": "void", "type": "void",
"nickname": "deletePet", "nickname": "deletePet",
"authorizations": {
"oauth2": [
{
"scope": "test:anything",
"description": "anything"
}
]
},
"parameters": [ "parameters": [
{ {
"name": "petId", "name": "petId",
"description": "Pet id to delete", "description": "Pet id to delete",
"required": true, "required": true,
"allowMultiple": false,
"type": "string", "type": "string",
"paramType": "path" "paramType": "path"
} }
@ -75,41 +173,18 @@
{ {
"path": "/pet", "path": "/pet",
"operations": [ "operations": [
{
"method": "POST",
"summary": "Add a new pet to the store",
"notes": "",
"type": "void",
"nickname": "addPet",
"parameters": [
{
"name": "body",
"description": "Pet object that needs to be added to the store",
"required": true,
"allowMultiple": false,
"type": "Pet",
"paramType": "body"
}
],
"responseMessages": [
{
"code": 405,
"message": "Invalid input"
}
]
},
{ {
"method": "PUT", "method": "PUT",
"summary": "Update an existing pet", "summary": "Update an existing pet",
"notes": "", "notes": "",
"type": "void", "type": "void",
"nickname": "updatePet", "nickname": "updatePet",
"authorizations": {},
"parameters": [ "parameters": [
{ {
"name": "body", "name": "body",
"description": "Pet object that needs to be updated in the store", "description": "Pet object that needs to be updated in the store",
"required": true, "required": true,
"allowMultiple": false,
"type": "Pet", "type": "Pet",
"paramType": "body" "paramType": "body"
} }
@ -128,6 +203,40 @@
"message": "Validation exception" "message": "Validation exception"
} }
] ]
},
{
"method": "POST",
"summary": "Add a new pet to the store",
"notes": "",
"type": "void",
"nickname": "addPet",
"consumes": [
"application/json",
"application/xml"
],
"authorizations": {
"oauth2": [
{
"scope": "test:anything",
"description": "anything"
}
]
},
"parameters": [
{
"name": "body",
"description": "Pet object that needs to be added to the store",
"required": true,
"type": "Pet",
"paramType": "body"
}
],
"responseMessages": [
{
"code": 405,
"message": "Invalid input"
}
]
} }
] ]
}, },
@ -143,17 +252,13 @@
"$ref": "Pet" "$ref": "Pet"
}, },
"nickname": "findPetsByStatus", "nickname": "findPetsByStatus",
"produces": [ "authorizations": {},
"application/json",
"application/xml"
],
"parameters": [ "parameters": [
{ {
"name": "status", "name": "status",
"description": "Status values that need to be considered for filter", "description": "Status values that need to be considered for filter",
"defaultValue": "available", "defaultValue": "available",
"required": true, "required": true,
"allowMultiple": true,
"type": "string", "type": "string",
"paramType": "query", "paramType": "query",
"enum": [ "enum": [
@ -184,16 +289,12 @@
"$ref": "Pet" "$ref": "Pet"
}, },
"nickname": "findPetsByTags", "nickname": "findPetsByTags",
"produces": [ "authorizations": {},
"application/json",
"application/xml"
],
"parameters": [ "parameters": [
{ {
"name": "tags", "name": "tags",
"description": "Tags to filter by", "description": "Tags to filter by",
"required": true, "required": true,
"allowMultiple": true,
"type": "string", "type": "string",
"paramType": "query" "paramType": "query"
} }
@ -207,24 +308,66 @@
"deprecated": "true" "deprecated": "true"
} }
] ]
},
{
"path": "/pet/uploadImage",
"operations": [
{
"method": "POST",
"summary": "uploads an image",
"notes": "",
"type": "void",
"nickname": "uploadFile",
"consumes": [
"multipart/form-data"
],
"authorizations": {
"oauth2": [
{
"scope": "test:anything",
"description": "anything"
},
{
"scope": "test:nothing",
"description": "nothing"
}
]
},
"parameters": [
{
"name": "additionalMetadata",
"description": "Additional data to pass to server",
"required": false,
"type": "string",
"paramType": "form"
},
{
"name": "file",
"description": "file to upload",
"required": false,
"type": "File",
"paramType": "body"
}
]
}
]
} }
], ],
"models": { "models": {
"Tag": { "Tag": {
"id": "Tag", "id": "Tag",
"properties": { "properties": {
"name": {
"type": "string"
},
"id": { "id": {
"type": "integer", "type": "integer",
"format": "int64" "format": "int64"
},
"name": {
"type": "string"
} }
} }
}, },
"Pet": { "Pet": {
"id": "Pet", "id": "Pet",
"description": "A pet is a person's best friend",
"required": [ "required": [
"id", "id",
"name" "name"
@ -232,7 +375,22 @@
"properties": { "properties": {
"id": { "id": {
"type": "integer", "type": "integer",
"format": "int64" "format": "int64",
"description": "unique identifier for the pet",
"minimum": "0.0",
"maximum": "100.0"
},
"category": {
"$ref": "Category"
},
"name": {
"type": "string"
},
"photoUrls": {
"type": "array",
"items": {
"type": "string"
}
}, },
"tags": { "tags": {
"type": "array", "type": "array",
@ -240,9 +398,6 @@
"$ref": "Tag" "$ref": "Tag"
} }
}, },
"name": {
"type": "string"
},
"status": { "status": {
"type": "string", "type": "string",
"description": "pet status in the store", "description": "pet status in the store",
@ -251,27 +406,18 @@
"pending", "pending",
"sold" "sold"
] ]
},
"category": {
"$ref": "Category"
},
"photoUrls": {
"type": "array",
"items": {
"type": "string"
}
} }
} }
}, },
"Category": { "Category": {
"id": "Category", "id": "Category",
"properties": { "properties": {
"name": {
"type": "string"
},
"id": { "id": {
"type": "integer", "type": "integer",
"format": "int64" "format": "int64"
},
"name": {
"type": "string"
} }
} }
} }

View File

@ -1,11 +1,10 @@
{ {
"apiVersion": "1.0.0", "apiVersion": "1.0.0",
"swaggerVersion": "1.2", "swaggerVersion": "1.2",
"basePath": "http://localhost:8002/api", "basePath": "http://petstore.swagger.wordnik.com/api",
"resourcePath": "/store", "resourcePath": "/store",
"produces": [ "produces": [
"application/json", "application/json"
"application/xml"
], ],
"apis": [ "apis": [
{ {
@ -17,16 +16,12 @@
"notes": "For valid response try integer IDs with value <= 5. Anything above 5 or nonintegers will generate API errors", "notes": "For valid response try integer IDs with value <= 5. Anything above 5 or nonintegers will generate API errors",
"type": "Order", "type": "Order",
"nickname": "getOrderById", "nickname": "getOrderById",
"produces": [ "authorizations": {},
"application/json",
"application/xml"
],
"parameters": [ "parameters": [
{ {
"name": "orderId", "name": "orderId",
"description": "ID of pet that needs to be fetched", "description": "ID of pet that needs to be fetched",
"required": true, "required": true,
"allowMultiple": false,
"type": "string", "type": "string",
"paramType": "path" "paramType": "path"
} }
@ -48,12 +43,19 @@
"notes": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", "notes": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
"type": "void", "type": "void",
"nickname": "deleteOrder", "nickname": "deleteOrder",
"authorizations": {
"oauth2": [
{
"scope": "test:anything",
"description": "anything"
}
]
},
"parameters": [ "parameters": [
{ {
"name": "orderId", "name": "orderId",
"description": "ID of the order that needs to be deleted", "description": "ID of the order that needs to be deleted",
"required": true, "required": true,
"allowMultiple": false,
"type": "string", "type": "string",
"paramType": "path" "paramType": "path"
} }
@ -80,12 +82,19 @@
"notes": "", "notes": "",
"type": "void", "type": "void",
"nickname": "placeOrder", "nickname": "placeOrder",
"authorizations": {
"oauth2": [
{
"scope": "test:anything",
"description": "anything"
}
]
},
"parameters": [ "parameters": [
{ {
"name": "body", "name": "body",
"description": "order placed for purchasing the pet", "description": "order placed for purchasing the pet",
"required": true, "required": true,
"allowMultiple": false,
"type": "Order", "type": "Order",
"paramType": "body" "paramType": "body"
} }
@ -108,15 +117,6 @@
"type": "integer", "type": "integer",
"format": "int64" "format": "int64"
}, },
"status": {
"type": "string",
"description": "Order Status",
"enum": [
"placed",
"approved",
"delivered"
]
},
"petId": { "petId": {
"type": "integer", "type": "integer",
"format": "int64" "format": "int64"
@ -125,6 +125,15 @@
"type": "integer", "type": "integer",
"format": "int32" "format": "int32"
}, },
"status": {
"type": "string",
"description": "Order Status",
"enum": [
"placed",
" approved",
" delivered"
]
},
"shipDate": { "shipDate": {
"type": "string", "type": "string",
"format": "date-time" "format": "date-time"

View File

@ -1,11 +1,10 @@
{ {
"apiVersion": "1.0.0", "apiVersion": "1.0.0",
"swaggerVersion": "1.2", "swaggerVersion": "1.2",
"basePath": "http://localhost:8002/api", "basePath": "http://petstore.swagger.wordnik.com/api",
"resourcePath": "/user", "resourcePath": "/user",
"produces": [ "produces": [
"application/json", "application/json"
"application/xml"
], ],
"apis": [ "apis": [
{ {
@ -17,12 +16,19 @@
"notes": "This can only be done by the logged in user.", "notes": "This can only be done by the logged in user.",
"type": "void", "type": "void",
"nickname": "createUser", "nickname": "createUser",
"authorizations": {
"oauth2": [
{
"scope": "test:anything",
"description": "anything"
}
]
},
"parameters": [ "parameters": [
{ {
"name": "body", "name": "body",
"description": "Created user object", "description": "Created user object",
"required": true, "required": true,
"allowMultiple": false,
"type": "User", "type": "User",
"paramType": "body" "paramType": "body"
} }
@ -30,6 +36,20 @@
} }
] ]
}, },
{
"path": "/user/logout",
"operations": [
{
"method": "GET",
"summary": "Logs out current logged in user session",
"notes": "",
"type": "void",
"nickname": "logoutUser",
"authorizations": {},
"parameters": []
}
]
},
{ {
"path": "/user/createWithArray", "path": "/user/createWithArray",
"operations": [ "operations": [
@ -39,12 +59,19 @@
"notes": "", "notes": "",
"type": "void", "type": "void",
"nickname": "createUsersWithArrayInput", "nickname": "createUsersWithArrayInput",
"authorizations": {
"oauth2": [
{
"scope": "test:anything",
"description": "anything"
}
]
},
"parameters": [ "parameters": [
{ {
"name": "body", "name": "body",
"description": "List of user object", "description": "List of user object",
"required": true, "required": true,
"allowMultiple": false,
"type": "array", "type": "array",
"items": { "items": {
"$ref": "User" "$ref": "User"
@ -64,12 +91,19 @@
"notes": "", "notes": "",
"type": "void", "type": "void",
"nickname": "createUsersWithListInput", "nickname": "createUsersWithListInput",
"authorizations": {
"oauth2": [
{
"scope": "test:anything",
"description": "anything"
}
]
},
"parameters": [ "parameters": [
{ {
"name": "body", "name": "body",
"description": "List of user object", "description": "List of user object",
"required": true, "required": true,
"allowMultiple": false,
"type": "array", "type": "array",
"items": { "items": {
"$ref": "User" "$ref": "User"
@ -89,12 +123,19 @@
"notes": "This can only be done by the logged in user.", "notes": "This can only be done by the logged in user.",
"type": "void", "type": "void",
"nickname": "updateUser", "nickname": "updateUser",
"authorizations": {
"oauth2": [
{
"scope": "test:anything",
"description": "anything"
}
]
},
"parameters": [ "parameters": [
{ {
"name": "username", "name": "username",
"description": "name that need to be deleted", "description": "name that need to be deleted",
"required": true, "required": true,
"allowMultiple": false,
"type": "string", "type": "string",
"paramType": "path" "paramType": "path"
}, },
@ -102,7 +143,6 @@
"name": "body", "name": "body",
"description": "Updated user object", "description": "Updated user object",
"required": true, "required": true,
"allowMultiple": false,
"type": "User", "type": "User",
"paramType": "body" "paramType": "body"
} }
@ -124,12 +164,19 @@
"notes": "This can only be done by the logged in user.", "notes": "This can only be done by the logged in user.",
"type": "void", "type": "void",
"nickname": "deleteUser", "nickname": "deleteUser",
"authorizations": {
"oauth2": [
{
"scope": "test:anything",
"description": "anything"
}
]
},
"parameters": [ "parameters": [
{ {
"name": "username", "name": "username",
"description": "The name that needs to be deleted", "description": "The name that needs to be deleted",
"required": true, "required": true,
"allowMultiple": false,
"type": "string", "type": "string",
"paramType": "path" "paramType": "path"
} }
@ -151,16 +198,12 @@
"notes": "", "notes": "",
"type": "User", "type": "User",
"nickname": "getUserByName", "nickname": "getUserByName",
"produces": [ "authorizations": {},
"application/json",
"application/xml"
],
"parameters": [ "parameters": [
{ {
"name": "username", "name": "username",
"description": "The name that needs to be fetched. Use user1 for testing.", "description": "The name that needs to be fetched. Use user1 for testing.",
"required": true, "required": true,
"allowMultiple": false,
"type": "string", "type": "string",
"paramType": "path" "paramType": "path"
} }
@ -187,15 +230,12 @@
"notes": "", "notes": "",
"type": "string", "type": "string",
"nickname": "loginUser", "nickname": "loginUser",
"produces": [ "authorizations": {},
"text/plain"
],
"parameters": [ "parameters": [
{ {
"name": "username", "name": "username",
"description": "The user name for login", "description": "The user name for login",
"required": true, "required": true,
"allowMultiple": false,
"type": "string", "type": "string",
"paramType": "query" "paramType": "query"
}, },
@ -203,7 +243,6 @@
"name": "password", "name": "password",
"description": "The password for login in clear text", "description": "The password for login in clear text",
"required": true, "required": true,
"allowMultiple": false,
"type": "string", "type": "string",
"paramType": "query" "paramType": "query"
} }
@ -216,22 +255,6 @@
] ]
} }
] ]
},
{
"path": "/user/logout",
"operations": [
{
"method": "GET",
"summary": "Logs out current logged in user session",
"notes": "",
"type": "void",
"nickname": "logoutUser",
"produces": [
"text/plain"
],
"parameters": []
}
]
} }
], ],
"models": { "models": {
@ -242,19 +265,19 @@
"type": "integer", "type": "integer",
"format": "int64" "format": "int64"
}, },
"firstName": {
"type": "string"
},
"username": { "username": {
"type": "string" "type": "string"
}, },
"password": { "lastName": {
"type": "string" "type": "string"
}, },
"email": { "email": {
"type": "string" "type": "string"
}, },
"firstName": { "password": {
"type": "string"
},
"lastName": {
"type": "string" "type": "string"
}, },
"phone": { "phone": {