renamed to separate spec versions

This commit is contained in:
Tony Tam
2013-07-30 23:55:05 -07:00
parent b9a60649a8
commit fbc09aa77b
8 changed files with 761 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"apis": [
{
"path": "/pet",
"description": "Operations about pets"
},
{
"path": "/user",
"description": "Operations about user"
},
{
"path": "/store",
"description": "Operations about store"
}
],
"authorizations": {
"oauth2": {
"type": "oauth2",
"scopes": [
"PUBLIC"
],
"grantTypes": {
"implicit": {
"loginEndpoint": {
"url": "http://localhost:8002/oauth/dialog"
},
"tokenName": "access_code"
},
"authorization_code": {
"tokenRequestEndpoint": {
"url": "http://localhost:8002/oauth/requestToken",
"clientIdName": "client_id",
"clientSecretName": "client_secret"
},
"tokenEndpoint": {
"url": "http://localhost:8002/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.",
"termsOfServiceUrl": "http://helloreverb.com/terms/",
"contact": "apiteam@wordnik.com",
"license": "Apache 2.0",
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
}

View File

@@ -0,0 +1,284 @@
{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"basePath": "http://petstore.swagger.wordnik.com/api",
"resourcePath": "/pet",
"produces": [
"application/json",
"application/xml",
"text/plain",
"text/html"
],
"apis": [
{
"path": "/pet/{petId}",
"operations": [
{
"method": "GET",
"summary": "Find pet by ID",
"notes": "Returns a pet based on ID",
"responseClass": "Pet",
"nickname": "getPetById",
"produces": [
"application/json",
"application/xml"
],
"authorizations": [
"oauth2"
],
"parameters": [
{
"name": "petId",
"description": "ID of pet that needs to be fetched",
"required": true,
"allowMultiple": false,
"dataType": "string",
"paramType": "path"
}
],
"responseMessages": [
{
"code": 400,
"message": "Invalid ID supplied"
},
{
"code": 404,
"message": "Pet not found"
}
]
},
{
"method": "DELETE",
"summary": "Deletes a pet",
"notes": "",
"responseClass": "void",
"nickname": "deletePet",
"parameters": [
{
"name": "petId",
"description": "Pet id to delete",
"required": true,
"allowMultiple": false,
"dataType": "string",
"paramType": "path"
}
],
"responseMessages": [
{
"code": 400,
"message": "Invalid pet value"
}
]
}
]
},
{
"path": "/pet",
"operations": [
{
"method": "POST",
"summary": "Add a new pet to the store",
"notes": "",
"responseClass": "void",
"nickname": "addPet",
"parameters": [
{
"name": "body",
"description": "Pet object that needs to be added to the store",
"required": true,
"allowMultiple": false,
"dataType": "Pet",
"paramType": "body"
}
],
"responseMessages": [
{
"code": 405,
"message": "Invalid input"
}
]
},
{
"method": "PUT",
"summary": "Update an existing pet",
"notes": "",
"responseClass": "void",
"nickname": "updatePet",
"parameters": [
{
"name": "body",
"description": "Pet object that needs to be updated in the store",
"required": true,
"allowMultiple": false,
"dataType": "Pet",
"paramType": "body"
}
],
"responseMessages": [
{
"code": 400,
"message": "Invalid ID supplied"
},
{
"code": 404,
"message": "Pet not found"
},
{
"code": 405,
"message": "Validation exception"
}
]
}
]
},
{
"path": "/pet/findByStatus",
"operations": [
{
"method": "GET",
"summary": "Finds Pets by status",
"notes": "Multiple status values can be provided with comma seperated strings",
"responseClass": "List[Pet]",
"nickname": "findPetsByStatus",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"name": "status",
"description": "Status values that need to be considered for filter",
"defaultValue": "available",
"required": true,
"allowMultiple": true,
"dataType": "string",
"allowableValues": {
"valueType": "LIST",
"values": [
"available",
"pending",
"sold"
]
},
"paramType": "query"
}
],
"responseMessages": [
{
"code": 400,
"message": "Invalid status value"
}
]
}
]
},
{
"path": "/pet/findByTags",
"operations": [
{
"method": "GET",
"summary": "Finds Pets by tags",
"notes": "Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.",
"responseClass": "List[Pet]",
"nickname": "findPetsByTags",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"name": "tags",
"description": "Tags to filter by",
"required": true,
"allowMultiple": true,
"dataType": "string",
"paramType": "query"
}
],
"responseMessages": [
{
"code": 400,
"message": "Invalid tag value"
}
],
"deprecated": "true"
}
]
}
],
"models": {
"Tag": {
"id": "Tag",
"name": "Tag",
"properties": {
"name": {
"type": "string",
"required": false
},
"id": {
"type": "long",
"required": false
}
}
},
"Pet": {
"id": "Pet",
"name": "Pet",
"properties": {
"id": {
"type": "long",
"required": false
},
"name": {
"type": "string",
"required": false
},
"tags": {
"type": "List",
"required": false,
"items": {
"$ref": "Tag"
}
},
"photoUrls": {
"type": "List",
"required": false,
"items": {
"type": "string"
}
},
"status": {
"type": "string",
"required": false,
"description": "pet status in the store",
"allowableValues": {
"valueType": "LIST",
"values": [
"available",
"pending",
"sold"
]
}
},
"category": {
"type": "Category",
"required": false
}
}
},
"Category": {
"id": "Category",
"name": "Category",
"properties": {
"name": {
"type": "string",
"required": false
},
"id": {
"type": "long",
"required": false
}
}
}
}
}

View File

@@ -0,0 +1,140 @@
{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"basePath": "http://petstore.swagger.wordnik.com/api",
"resourcePath": "/store",
"produces": [
"application/json",
"application/xml"
],
"apis": [
{
"path": "/store/order/{orderId}",
"operations": [
{
"method": "GET",
"summary": "Find purchase order by ID",
"notes": "For valid response try integer IDs with value <= 5. Anything above 5 or nonintegers will generate API errors",
"responseClass": "Order",
"nickname": "getOrderById",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"name": "orderId",
"description": "ID of pet that needs to be fetched",
"required": true,
"allowMultiple": false,
"dataType": "string",
"paramType": "path"
}
],
"responseMessages": [
{
"code": 400,
"message": "Invalid ID supplied"
},
{
"code": 404,
"message": "Order not found"
}
]
},
{
"method": "DELETE",
"summary": "Delete purchase order by ID",
"notes": "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
"responseClass": "void",
"nickname": "deleteOrder",
"parameters": [
{
"name": "orderId",
"description": "ID of the order that needs to be deleted",
"required": true,
"allowMultiple": false,
"dataType": "string",
"paramType": "path"
}
],
"responseMessages": [
{
"code": 400,
"message": "Invalid ID supplied"
},
{
"code": 404,
"message": "Order not found"
}
]
}
]
},
{
"path": "/store/order",
"operations": [
{
"method": "POST",
"summary": "Place an order for a pet",
"notes": "",
"responseClass": "void",
"nickname": "placeOrder",
"parameters": [
{
"name": "body",
"description": "order placed for purchasing the pet",
"required": true,
"allowMultiple": false,
"dataType": "Order",
"paramType": "body"
}
],
"responseMessages": [
{
"code": 400,
"message": "Invalid order"
}
]
}
]
}
],
"models": {
"Order": {
"id": "Order",
"name": "Order",
"properties": {
"shipDate": {
"type": "Date",
"required": false
},
"quantity": {
"type": "int",
"required": false
},
"petId": {
"type": "long",
"required": false
},
"id": {
"type": "long",
"required": false
},
"status": {
"type": "string",
"required": false,
"description": "Order Status",
"allowableValues": {
"valueType": "LIST",
"values": [
"placed",
"approved",
"delivered"
]
}
}
}
}
}
}

View File

@@ -0,0 +1,280 @@
{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"basePath": "http://petstore.swagger.wordnik.com/api",
"resourcePath": "/user",
"produces": [
"application/json",
"application/xml"
],
"apis": [
{
"path": "/user",
"operations": [
{
"method": "POST",
"summary": "Create user",
"notes": "This can only be done by the logged in user.",
"responseClass": "void",
"nickname": "createUser",
"parameters": [
{
"name": "body",
"description": "Created user object",
"required": true,
"allowMultiple": false,
"dataType": "User",
"paramType": "body"
}
]
}
]
},
{
"path": "/user/createWithArray",
"operations": [
{
"method": "POST",
"summary": "Creates list of users with given input array",
"notes": "",
"responseClass": "void",
"nickname": "createUsersWithArrayInput",
"parameters": [
{
"name": "body",
"description": "List of user object",
"required": true,
"allowMultiple": false,
"dataType": "Array[User]",
"paramType": "body"
}
]
}
]
},
{
"path": "/user/createWithList",
"operations": [
{
"method": "POST",
"summary": "Creates list of users with given list input",
"notes": "",
"responseClass": "void",
"nickname": "createUsersWithListInput",
"parameters": [
{
"name": "body",
"description": "List of user object",
"required": true,
"allowMultiple": false,
"dataType": "List[User]",
"paramType": "body"
}
]
}
]
},
{
"path": "/user/{username}",
"operations": [
{
"method": "PUT",
"summary": "Updated user",
"notes": "This can only be done by the logged in user.",
"responseClass": "void",
"nickname": "updateUser",
"parameters": [
{
"name": "username",
"description": "name that need to be deleted",
"required": true,
"allowMultiple": false,
"dataType": "string",
"paramType": "path"
},
{
"name": "body",
"description": "Updated user object",
"required": true,
"allowMultiple": false,
"dataType": "User",
"paramType": "body"
}
],
"responseMessages": [
{
"code": 400,
"message": "Invalid username supplied"
},
{
"code": 404,
"message": "User not found"
}
]
},
{
"method": "DELETE",
"summary": "Delete user",
"notes": "This can only be done by the logged in user.",
"responseClass": "void",
"nickname": "deleteUser",
"parameters": [
{
"name": "username",
"description": "The name that needs to be deleted",
"required": true,
"allowMultiple": false,
"dataType": "string",
"paramType": "path"
}
],
"responseMessages": [
{
"code": 400,
"message": "Invalid username supplied"
},
{
"code": 404,
"message": "User not found"
}
]
},
{
"method": "GET",
"summary": "Get user by user name",
"notes": "",
"responseClass": "User",
"nickname": "getUserByName",
"produces": [
"application/json",
"application/xml"
],
"parameters": [
{
"name": "username",
"description": "The name that needs to be fetched. Use user1 for testing.",
"required": true,
"allowMultiple": false,
"dataType": "string",
"paramType": "path"
}
],
"responseMessages": [
{
"code": 400,
"message": "Invalid username supplied"
},
{
"code": 404,
"message": "User not found"
}
]
}
]
},
{
"path": "/user/login",
"operations": [
{
"method": "GET",
"summary": "Logs user into the system",
"notes": "",
"responseClass": "string",
"nickname": "loginUser",
"produces": [
"text/plain"
],
"parameters": [
{
"name": "username",
"description": "The user name for login",
"required": true,
"allowMultiple": false,
"dataType": "string",
"paramType": "query"
},
{
"name": "password",
"description": "The password for login in clear text",
"required": true,
"allowMultiple": false,
"dataType": "string",
"paramType": "query"
}
],
"responseMessages": [
{
"code": 400,
"message": "Invalid username and password combination"
}
]
}
]
},
{
"path": "/user/logout",
"operations": [
{
"method": "GET",
"summary": "Logs out current logged in user session",
"notes": "",
"responseClass": "void",
"nickname": "logoutUser",
"produces": [
"text/plain"
],
"parameters": []
}
]
}
],
"models": {
"User": {
"id": "User",
"name": "User",
"properties": {
"email": {
"type": "string",
"required": false
},
"username": {
"type": "string",
"required": false
},
"userStatus": {
"type": "int",
"required": false,
"description": "User Status",
"allowableValues": {
"valueType": "LIST",
"values": [
"1-registered",
"2-active",
"3-closed"
]
}
},
"lastName": {
"type": "string",
"required": false
},
"firstName": {
"type": "string",
"required": false
},
"id": {
"type": "long",
"required": false
},
"phone": {
"type": "string",
"required": false
},
"password": {
"type": "string",
"required": false
}
}
}
}
}