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",
"description": "Operations about pets"
},
{
"path": "/store",
"description": "Operations about store"
},
{
"path": "/user",
"description": "Operations about user"
},
{
"path": "/store",
"description": "Operations about store"
}
],
"authorizations": {
"oauth2": {
"type": "oauth2",
"scopes": [
"PUBLIC"
{
"scope": "email",
"description": "Access to your email address"
},
{
"scope": "pets",
"description": "Access to your pets"
}
],
"grantTypes": {
"implicit": {
"loginEndpoint": {
"url": "http://localhost:8002/oauth/dialog"
"url": "http://petstore.swagger.wordnik.com/oauth/dialog"
},
"tokenName": "access_code"
"tokenName": "access_token"
},
"authorization_code": {
"tokenRequestEndpoint": {
"url": "http://localhost:8002/oauth/requestToken",
"url": "http://petstore.swagger.wordnik.com/oauth/requestToken",
"clientIdName": "client_id",
"clientSecretName": "client_secret"
},
"tokenEndpoint": {
"url": "http://localhost:8002/oauth/token",
"url": "http://petstore.swagger.wordnik.com/oauth/token",
"tokenName": "access_code"
}
}
}
},
"apiKey": {
"type": "apiKey",
"passAs": "header"
}
},
"info": {
"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/",
"contact": "apiteam@wordnik.com",
"license": "Apache 2.0",

View File

@ -1,7 +1,7 @@
{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"basePath": "http://localhost:8002/api",
"basePath": "http://petstore.swagger.wordnik.com/api",
"resourcePath": "/pet",
"produces": [
"application/json",
@ -19,21 +19,17 @@
"notes": "Returns a pet based on ID",
"type": "Pet",
"nickname": "getPetById",
"produces": [
"application/json",
"application/xml"
],
"authorizations": [
"oauth2"
],
"authorizations": {},
"parameters": [
{
"name": "petId",
"description": "ID of pet that needs to be fetched",
"required": true,
"allowMultiple": false,
"type": "string",
"paramType": "path"
"type": "integer",
"format": "int64",
"paramType": "path",
"minimum": "1.0",
"maximum": "100000.0"
}
],
"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",
"summary": "Deletes a pet",
"notes": "",
"type": "void",
"nickname": "deletePet",
"authorizations": {
"oauth2": [
{
"scope": "test:anything",
"description": "anything"
}
]
},
"parameters": [
{
"name": "petId",
"description": "Pet id to delete",
"required": true,
"allowMultiple": false,
"type": "string",
"paramType": "path"
}
@ -75,41 +173,18 @@
{
"path": "/pet",
"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",
"summary": "Update an existing pet",
"notes": "",
"type": "void",
"nickname": "updatePet",
"authorizations": {},
"parameters": [
{
"name": "body",
"description": "Pet object that needs to be updated in the store",
"required": true,
"allowMultiple": false,
"type": "Pet",
"paramType": "body"
}
@ -128,6 +203,40 @@
"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"
},
"nickname": "findPetsByStatus",
"produces": [
"application/json",
"application/xml"
],
"authorizations": {},
"parameters": [
{
"name": "status",
"description": "Status values that need to be considered for filter",
"defaultValue": "available",
"required": true,
"allowMultiple": true,
"type": "string",
"paramType": "query",
"enum": [
@ -184,16 +289,12 @@
"$ref": "Pet"
},
"nickname": "findPetsByTags",
"produces": [
"application/json",
"application/xml"
],
"authorizations": {},
"parameters": [
{
"name": "tags",
"description": "Tags to filter by",
"required": true,
"allowMultiple": true,
"type": "string",
"paramType": "query"
}
@ -207,24 +308,66 @@
"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": {
"Tag": {
"id": "Tag",
"properties": {
"name": {
"type": "string"
},
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
}
}
},
"Pet": {
"id": "Pet",
"description": "A pet is a person's best friend",
"required": [
"id",
"name"
@ -232,7 +375,22 @@
"properties": {
"id": {
"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": {
"type": "array",
@ -240,9 +398,6 @@
"$ref": "Tag"
}
},
"name": {
"type": "string"
},
"status": {
"type": "string",
"description": "pet status in the store",
@ -251,27 +406,18 @@
"pending",
"sold"
]
},
"category": {
"$ref": "Category"
},
"photoUrls": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"Category": {
"id": "Category",
"properties": {
"name": {
"type": "string"
},
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
}
}
}

View File

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

View File

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