diff --git a/docfx.json b/docfx.json index 4280dc2..94c6972 100644 --- a/docfx.json +++ b/docfx.json @@ -19,7 +19,7 @@ "dest": "api" }, { - "files": [ "articles/**/*.md", "*.md", "toc.yml" ] + "files": [ "articles/**/*.md", "*.md", "toc.yml", "restapi/**" ] } ], "resource": [ diff --git a/restapi/contacts_swagger2.json b/restapi/contacts_swagger2.json new file mode 100644 index 0000000..a3bdbde --- /dev/null +++ b/restapi/contacts_swagger2.json @@ -0,0 +1,691 @@ +{ + "swagger": "2.0", + "info": { + "title": "Contacts", + "version": "1.6" + }, + "paths": { + "/contacts": { + "get": { + "parameters": [ + { + "in": "query", + "description": "The version of the Graph API to target. Beginning with version 1.5, the api-version string is represented in major.minor format. Prior releases were represented as date strings: '2013-11-08' and '2013-04-05'. Required.", + "name": "api-version", + "required": true, + "type": "string", + "enum": [ + "1.5", + "1.6" + ], + "default": "1.6" + } + ], + "responses": { + "200": { + "description": "OK. Indicates success. The results are returned in the response body.", + "examples": { + "application/json": { + "odata.metadata": "https://graph.windows.net/myorganization/$metadata#directoryObjects/Microsoft.DirectoryServices.Contact", + "value": [ + { + "odata.type": "Microsoft.DirectoryServices.Contact", + "objectType": "Contact", + "objectId": "31944231-fd52-4a7f-b32e-7902a01fddf9", + "deletionTimestamp": null, + "city": null, + "companyName": null, + "country": null, + "department": null, + "dirSyncEnabled": null, + "displayName": "Marcus Breyer", + "facsimileTelephoneNumber": null, + "givenName": "Marcus", + "jobTitle": null, + "lastDirSyncTime": null, + "mail": "Marcus@contoso.com", + "mailNickname": "MarcusBreyer", + "mobile": null, + "physicalDeliveryOfficeName": null, + "postalCode": null, + "provisioningErrors": [], + "proxyAddresses": [ + "SMTP:Marcus@contoso.com" + ], + "sipProxyAddress": null, + "state": null, + "streetAddress": null, + "surname": "Breyer", + "telephoneNumber": null + }, + { + "odata.type": "Microsoft.DirectoryServices.Contact", + "objectType": "Contact", + "objectId": "35110b16-360c-4c4a-93b2-03f065fabd93", + "deletionTimestamp": null, + "city": null, + "companyName": null, + "country": null, + "department": null, + "dirSyncEnabled": null, + "displayName": "Yossi Ran", + "facsimileTelephoneNumber": null, + "givenName": "Yossi", + "jobTitle": null, + "lastDirSyncTime": null, + "mail": "Yossi@contoso.com", + "mailNickname": "YossiRan", + "mobile": null, + "physicalDeliveryOfficeName": null, + "postalCode": null, + "provisioningErrors": [], + "proxyAddresses": [ + "SMTP:Yossi@contoso.com" + ], + "sipProxyAddress": null, + "state": null, + "streetAddress": null, + "surname": "Ran", + "telephoneNumber": null + }, + { + "odata.type": "Microsoft.DirectoryServices.Contact", + "objectType": "Contact", + "objectId": "7163f3b8-70c9-43d2-b9e1-4467ddaf087a", + "deletionTimestamp": null, + "city": null, + "companyName": null, + "country": null, + "department": null, + "dirSyncEnabled": null, + "displayName": "Jeremy Nelson", + "facsimileTelephoneNumber": null, + "givenName": "Jeremy", + "jobTitle": null, + "lastDirSyncTime": null, + "mail": "Jeremy@contoso.com", + "mailNickname": "JeremyNelson", + "mobile": null, + "physicalDeliveryOfficeName": null, + "postalCode": null, + "provisioningErrors": [], + "proxyAddresses": [ + "SMTP:Jeremy@contoso.com" + ], + "sipProxyAddress": null, + "state": null, + "streetAddress": null, + "surname": "Nelson", + "telephoneNumber": null + }, + { + "odata.type": "Microsoft.DirectoryServices.Contact", + "objectType": "Contact", + "objectId": "83234b5c-3a10-4108-8f36-39b1addadfdb", + "deletionTimestamp": null, + "city": null, + "companyName": null, + "country": null, + "department": null, + "dirSyncEnabled": null, + "displayName": "David Strome", + "facsimileTelephoneNumber": null, + "givenName": "David", + "jobTitle": null, + "lastDirSyncTime": null, + "mail": "David@contoso.com", + "mailNickname": "DavidStrome", + "mobile": null, + "physicalDeliveryOfficeName": null, + "postalCode": null, + "provisioningErrors": [], + "proxyAddresses": [ + "SMTP:David@contoso.com" + ], + "sipProxyAddress": null, + "state": null, + "streetAddress": null, + "surname": "Strome", + "telephoneNumber": null + }, + { + "odata.type": "Microsoft.DirectoryServices.Contact", + "objectType": "Contact", + "objectId": "8c1315ce-bf6f-4e26-b24f-c830606ef41c", + "deletionTimestamp": null, + "city": null, + "companyName": null, + "country": null, + "department": null, + "dirSyncEnabled": null, + "displayName": "Holly Holt", + "facsimileTelephoneNumber": null, + "givenName": "Holly", + "jobTitle": null, + "lastDirSyncTime": null, + "mail": "Holly@contoso.com", + "mailNickname": "HollyHolt", + "mobile": null, + "physicalDeliveryOfficeName": null, + "postalCode": null, + "provisioningErrors": [], + "proxyAddresses": [ + "SMTP:Holly@contoso.com" + ], + "sipProxyAddress": null, + "state": null, + "streetAddress": null, + "surname": "Holt", + "telephoneNumber": null + } + ] + } + } + } + }, + "description": "

Required scope: Contacts.Read or Contacts.Write

", + "summary": "You can get a collection of contacts from your tenant.", + "operationId": "get contacts" + } + }, + "/contacts/{object_id}": { + "get": { + "parameters": [ + { + "in": "path", + "description": "The object ID (GUID) of the target contact.", + "name": "object_id", + "required": true, + "type": "string", + "default": "31944231-fd52-4a7f-b32e-7902a01fddf9" + }, + { + "in": "query", + "description": "Specifies the version of the Graph API to target. Beginning with version 1.5, the api-version string is represented in major.minor format. Prior releases were represented as date strings: '2013-11-08' and '2013-04-05'. Required.", + "name": "api-version", + "required": true, + "type": "string", + "enum": [ + "1.5", + "1.6" + ], + "default": "1.6" + } + ], + "responses": { + "200": { + "description": "OK. Indicates success. The contact is returned in the response body.", + "examples": { + "application/json": { + "odata.metadata": "https://graph.windows.net/graphdir1.onmicrosoft.com/$metadata#directoryObjects/Microsoft.DirectoryServices.Contact/@Element", + "odata.type": "Microsoft.DirectoryServices.Contact", + "objectType": "Contact", + "objectId": "31944231-fd52-4a7f-b32e-7902a01fddf9", + "deletionTimestamp": null, + "city": null, + "companyName": null, + "country": null, + "department": null, + "dirSyncEnabled": null, + "displayName": "Marcus Breyer", + "facsimileTelephoneNumber": null, + "givenName": "Marcus", + "jobTitle": null, + "lastDirSyncTime": null, + "mail": "Marcus@contoso.com", + "mailNickname": "MarcusBreyer", + "mobile": null, + "physicalDeliveryOfficeName": null, + "postalCode": null, + "provisioningErrors": [], + "proxyAddresses": [ + "SMTP:Marcus@contoso.com" + ], + "sipProxyAddress": null, + "state": null, + "streetAddress": null, + "surname": "Breyer", + "telephoneNumber": null + } + } + } + }, + "description": "

Required scope: Contacts.Read or Contacts.Write

", + "summary": "Get a contact by using the object ID.", + "operationId": "get contact by id" + }, + "patch": { + "parameters": [ + { + "in": "path", + "description": "The object ID (GUID) of the target contact.", + "name": "object_id", + "required": true, + "type": "string", + "default": "7163f3b8-70c9-43d2-b9e1-4467ddaf087a" + }, + { + "in": "query", + "description": "The version of the Graph API to target. Beginning with version 1.5, the api-version string is represented in major.minor format. Prior releases were represented as date strings: '2013-11-08' and '2013-04-05'. Required.", + "name": "api-version", + "required": true, + "type": "string", + "enum": [ + "1.5", + "1.6" + ], + "default": "1.6" + }, + { + "in": "body", + "description": "this is request body, not real parameter", + "name": "bodyparam", + "required": false, + "schema": { + "$ref": "#/definitions/contact", + "example": { + "department": "Sales", + "jobTitle": "Sales Rep" + } + } + } + ], + "responses": { + "204": { + "description": "No Content. Indicates success. No response body is returned.", + } + }, + "description": "

Required scope: Contacts.Write

", + "summary": "Change a contact's properties.", + "operationId": "update contact" + }, + "delete": { + "parameters": [ + { + "in": "path", + "description": "The object ID (GUID) of the target contact.", + "name": "object_id", + "required": true, + "type": "string", + "default": "7163f3b8-70c9-43d2-b9e1-4467ddaf087a" + }, + { + "in": "query", + "description": "Specifies the version of the Graph API to target. Beginning with version 1.5, the api-version string is represented in major.minor format. Prior releases were represented as date strings: '2013-11-08' and '2013-04-05'. Required.", + "name": "api-version", + "required": false, + "type": "string", + "enum": [ + "1.5", + "1.6" + ], + "default": "1.6" + } + ], + "responses": { + "204": { + "description": "No Content. Indicates success.", + } + }, + "description": "

Required scope: Contacts.Write

", + "summary": "Delete a contact.", + "operationId": "delete contact" + } + }, + "/contacts/{object_id}/$links/manager": { + "get": { + "parameters": [ + { + "in": "path", + "description": "The object ID (GUID) of the target contact.", + "name": "object_id", + "required": true, + "type": "string", + "default": "31944231-fd52-4a7f-b32e-7902a01fddf9" + }, + { + "in": "query", + "description": "The version of the Graph API to target. Beginning with version 1.5, the api-version string is represented in major.minor format. Prior releases were represented as date strings: '2013-11-08' and '2013-04-05'. Required.", + "name": "api-version", + "required": true, + "type": "string", + "enum": [ + "1.5", + "1.6" + ], + "default": "1.6" + } + ], + "responses": { + "200": { + "description": "OK. Indicates success. A link to the contact's manager is returned.", + "examples": { + "application/json": { + "odata.metadata": "https://graph.windows.net/myorganization/$metadata#directoryObjects/$links/manager", + "url": "https://graph.windows.net/myorganization/directoryObjects/35110b16-360c-4c4a-93b2-03f065fabd93/Microsoft.WindowsAzure.ActiveDirectory.Contact" + } + } + }, + "404": { + "description": "Not Found. The requested resource was not found. This can occur if the manager property is not currently set for the specified contact. It can also have other causes, for example, a bad domain. A code and associated message is returned with the error.", + "examples": { + "application/json": { + "odata.error": { + "code": "Request_ResourceNotFound", + "message": { + "lang": "en", + "value": "Resource not found for the segment 'manager'." + } + } + } + } + } + }, + "description": "

Required scope: Contacts.Read or Contacts.Write

", + "summary": "Get a link to the contact's manager.", + "operationId": "get contact manager link" + }, + "put": { + "parameters": [ + { + "in": "path", + "description": "The object ID (GUID) of the target contact.", + "name": "object_id", + "required": true, + "type": "string", + "default": "31944231-fd52-4a7f-b32e-7902a01fddf9" + }, + { + "in": "query", + "description": "The version of the Graph API to target. Beginning with version 1.5, the api-version string is represented in major.minor format. Prior releases were represented as date strings: '2013-11-08' and '2013-04-05'. Required.", + "name": "api-version", + "required": true, + "type": "string", + "enum": [ + "1.5", + "1.6" + ], + "default": "1.6" + }, + { + "in": "body", + "description": "The request body contains a single property that specifies the URL of the user or contact to add as manager.", + "name": "bodyparam", + "required": true, + "schema": { + "required": [ + "url" + ], + "properties": { + "url": { + "type": "string" + } + }, + "example": { + "url": "https://graph.windows.net/myorganization/directoryObjects/35110b16-360c-4c4a-93b2-03f065fabd93" + } + } + } + ], + "responses": { + "204": { + "description": "No Content. Indicates success. No response body is returned.", + } + }, + "description": "

Required scope: Contacts.Write

", + "summary": "Update the contact's manager", + "operationId": "update contact manager" + }, + "delete": { + "parameters": [ + { + "in": "path", + "description": "The object ID (GUID) of the target contact.", + "name": "object_id", + "required": true, + "type": "string", + "default": "31944231-fd52-4a7f-b32e-7902a01fddf9" + }, + { + "in": "query", + "description": "The version of the Graph API to target. Beginning with version 1.5, the api-version string is represented in major.minor format. Prior releases were represented as date strings: '2013-11-08' and '2013-04-05'. Required.", + "name": "api-version", + "required": true, + "type": "string", + "enum": [ + "1.5", + "1.6" + ], + "default": "1.6" + } + ], + "responses": { + "204": { + "description": "No Content. Indicates success. N response body is returned.", + } + }, + "description": "

Required scope: Contacts.Write

", + "summary": "Delete the contact's manager.", + "operationId": "delete contact manager by id" + } + }, + "/contacts/{object_id}/$links/directReports": { + "get": { + "parameters": [ + { + "in": "path", + "description": "The object ID (GUID) of the target contact.", + "name": "object_id", + "required": true, + "type": "string", + "default": "31944231-fd52-4a7f-b32e-7902a01fddf9" + }, + { + "in": "query", + "description": "The version of the Graph API to target. Beginning with version 1.5, the api-version string is represented in major.minor format. Prior releases were represented as date strings: '2013-11-08' and '2013-04-05'. Required.", + "name": "api-version", + "required": true, + "type": "string", + "enum": [ + "1.5", + "1.6" + ], + "default": "1.6" + } + ], + "responses": { + "200": { + "description": "OK. Indicates success. One or more direct reports are returned.", + "examples": { + "application/json": { + "odata.metadata": "https://graph.windows.net/myorganization/$metadata#directoryObjects/$links/directReports", + "value": [ + { + "url": "https://graph.windows.net/myorganization/directoryObjects/8c1315ce-bf6f-4e26-b24f-c830606ef41c/Microsoft.DirectoryServices.Contact" + } + ] + } + } + } + }, + "description": "

Required scope: Contacts.Read or Contacts.Write

", + "summary": "Get a links to the contact's direct reports.", + "operationId": "get contact direct reports links" + } + }, + "/contacts/{object_id}/$links/memberOf": { + "get": { + "parameters": [ + { + "in": "path", + "description": "The object ID (GUID) of the target contact.", + "name": "object_id", + "required": true, + "type": "string", + "default": "31944231-fd52-4a7f-b32e-7902a01fddf9" + }, + { + "in": "query", + "description": "The version of the Graph API to target. Beginning with version 1.5, the api-version string is represented in major.minor format. Prior releases were represented as date strings: '2013-11-08' and '2013-04-05'. Required.", + "name": "api-version", + "required": true, + "type": "string", + "enum": [ + "1.5", + "1.6" + ], + "default": "1.6" + } + ], + "responses": { + "200": { + "description": "OK. Indicates success. One or more groups and/or directory roles are returned.", + "examples": { + "application/json": { + "odata.metadata": "https://graph.windows.net/myorganization/$metadata#directoryObjects/$links/memberOf", + "value": [ + { + "url": "https://graph.windows.net/myorganization/directoryObjects/12345678-b942-47c9-a10e-a4bee353ce60/Microsoft.DirectoryServices.Group" + } + ] + } + } + } + }, + "description": "

Required scope: Contacts.Read or Contacts.Write

", + "summary": "Get a links to the contact's direct group and directory role memberships.", + "operationId": "get contact memberOf links" + } + } + }, + "host": "graph.windows.net", + "basePath": "/myorganization", + "schemes": [ + "https" + ], + "definitions": { + "contact": { + "properties": { + "objectType": { + "type": "string", + "readOnly": true + }, + "objectId": { + "type": "string", + "readOnly": true + }, + "deletionTimestamp": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "department": { + "type": "string" + }, + "dirSyncEnabled": { + "type": "boolean" + }, + "displayName": { + "type": "string" + }, + "facsimileTelephoneNumber": { + "type": "string" + }, + "givenName": { + "type": "string" + }, + "jobTitle": { + "type": "string" + }, + "lastDirSyncTime": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "mail": { + "type": "string" + }, + "mailNickname": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "physicalDeliveryOfficeName": { + "type": "string" + }, + "postalCode": { + "type": "string" + }, + "provisioningErrors": { + "type": "array", + "items": { + "$ref": "#/definitions/ProvisioningError" + }, + "readOnly": true + }, + "proxyAddresses": { + "type": "array", + "items": { + "type": "string" + }, + "readOnly": true, + "example": { + "proxyAddresses": [ + "SMTP:garthf@a830edad9050849NDA1.onmicrosoft.com" + ] + } + }, + "sipProxyAddress": { + "type": "string", + "readOnly": true + }, + "state": { + "type": "string" + }, + "streetAddress": { + "type": "string" + }, + "surname": { + "type": "string" + }, + "telephoneNumber": { + "type": "string" + }, + "thumbnailPhoto": { + "type": "string" + } + }, + "required": [ + "displayName" + ] + }, + "ProvisioningError": { + "properties": { + "errorDetail": { + "type": "string", + "readOnly": true + }, + "resolved": { + "type": "boolean", + "readOnly": true + }, + "serviceInstance": { + "type": "string", + "readOnly": true + }, + "timestamp": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + } + } +} \ No newline at end of file diff --git a/restapi/petstore.swagger.json b/restapi/petstore.swagger.json new file mode 100644 index 0000000..d078e75 --- /dev/null +++ b/restapi/petstore.swagger.json @@ -0,0 +1,1035 @@ +{ + "basePath": "/v2", + "definitions": { + "ApiResponse": { + "properties": { + "code": { + "format": "int32", + "type": "integer" + }, + "message": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "Category": { + "properties": { + "id": { + "format": "int64", + "type": "integer" + }, + "name": { + "type": "string" + } + }, + "type": "object", + "xml": { + "name": "Category" + } + }, + "Order": { + "properties": { + "complete": { + "default": false, + "type": "boolean" + }, + "id": { + "format": "int64", + "type": "integer" + }, + "petId": { + "format": "int64", + "type": "integer" + }, + "quantity": { + "format": "int32", + "type": "integer" + }, + "shipDate": { + "format": "date-time", + "type": "string" + }, + "status": { + "description": "Order Status", + "enum": [ + "placed", + "approved", + "delivered" + ], + "type": "string" + } + }, + "type": "object", + "xml": { + "name": "Order" + } + }, + "Pet": { + "properties": { + "category": { + "$ref": "#/definitions/Category" + }, + "id": { + "format": "int64", + "type": "integer" + }, + "name": { + "example": "doggie", + "type": "string" + }, + "photoUrls": { + "items": { + "type": "string" + }, + "type": "array", + "xml": { + "name": "photoUrl", + "wrapped": true + } + }, + "status": { + "description": "pet status in the store", + "enum": [ + "available", + "pending", + "sold" + ], + "type": "string" + }, + "tags": { + "items": { + "$ref": "#/definitions/Tag" + }, + "type": "array", + "xml": { + "name": "tag", + "wrapped": true + } + } + }, + "required": [ + "name", + "photoUrls" + ], + "type": "object", + "xml": { + "name": "Pet" + } + }, + "Tag": { + "properties": { + "id": { + "format": "int64", + "type": "integer" + }, + "name": { + "type": "string" + } + }, + "type": "object", + "xml": { + "name": "Tag" + } + }, + "User": { + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "id": { + "format": "int64", + "type": "integer" + }, + "lastName": { + "type": "string" + }, + "password": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "userStatus": { + "description": "User Status", + "format": "int32", + "type": "integer" + }, + "username": { + "type": "string" + } + }, + "type": "object", + "xml": { + "name": "User" + } + } + }, + "externalDocs": { + "description": "Find out more about Swagger", + "url": "http://swagger.io" + }, + "host": "petstore.swagger.io", + "info": { + "contact": { + "email": "apiteam@swagger.io" + }, + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + }, + "termsOfService": "http://swagger.io/terms/", + "title": "Swagger Petstore", + "version": "1.0.0" + }, + "paths": { + "/pet": { + "post": { + "consumes": [ + "application/json", + "application/xml" + ], + "description": "", + "operationId": "addPet", + "parameters": [ + { + "description": "Pet object that needs to be added to the store", + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Pet" + } + } + ], + "produces": [ + "application/xml", + "application/json" + ], + "responses": { + "405": { + "description": "Invalid input" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ], + "summary": "Add a new pet to the store", + "tags": [ + "pet" + ] + }, + "put": { + "consumes": [ + "application/json", + "application/xml" + ], + "description": "", + "operationId": "updatePet", + "parameters": [ + { + "description": "Pet object that needs to be added to the store", + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Pet" + } + } + ], + "produces": [ + "application/xml", + "application/json" + ], + "responses": { + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Pet not found" + }, + "405": { + "description": "Validation exception" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ], + "summary": "Update an existing pet", + "tags": [ + "pet" + ] + } + }, + "/pet/findByStatus": { + "get": { + "description": "Multiple status values can be provided with comma separated strings", + "operationId": "findPetsByStatus", + "parameters": [ + { + "collectionFormat": "multi", + "description": "Status values that need to be considered for filter", + "in": "query", + "items": { + "default": "available", + "enum": [ + "available", + "pending", + "sold" + ], + "type": "string" + }, + "name": "status", + "required": true, + "type": "array" + } + ], + "produces": [ + "application/xml", + "application/json" + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "items": { + "$ref": "#/definitions/Pet" + }, + "type": "array" + } + }, + "400": { + "description": "Invalid status value" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ], + "summary": "Finds Pets by status", + "tags": [ + "pet" + ] + } + }, + "/pet/findByTags": { + "get": { + "deprecated": true, + "description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + "operationId": "findPetsByTags", + "parameters": [ + { + "collectionFormat": "multi", + "description": "Tags to filter by", + "in": "query", + "items": { + "type": "string" + }, + "name": "tags", + "required": true, + "type": "array" + } + ], + "produces": [ + "application/xml", + "application/json" + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "items": { + "$ref": "#/definitions/Pet" + }, + "type": "array" + } + }, + "400": { + "description": "Invalid tag value" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ], + "summary": "Finds Pets by tags", + "tags": [ + "pet" + ] + } + }, + "/pet/{petId}": { + "delete": { + "description": "", + "operationId": "deletePet", + "parameters": [ + { + "in": "header", + "name": "api_key", + "required": false, + "type": "string" + }, + { + "description": "Pet id to delete", + "format": "int64", + "in": "path", + "name": "petId", + "required": true, + "type": "integer" + } + ], + "produces": [ + "application/xml", + "application/json" + ], + "responses": { + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Pet not found" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ], + "summary": "Deletes a pet", + "tags": [ + "pet" + ] + }, + "get": { + "description": "Returns a single pet", + "operationId": "getPetById", + "parameters": [ + { + "description": "ID of pet to return", + "format": "int64", + "in": "path", + "name": "petId", + "required": true, + "type": "integer" + } + ], + "produces": [ + "application/xml", + "application/json" + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Pet" + } + }, + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Pet not found" + } + }, + "security": [ + { + "api_key": [] + } + ], + "summary": "Find pet by ID", + "tags": [ + "pet" + ] + }, + "post": { + "consumes": [ + "application/x-www-form-urlencoded" + ], + "description": "", + "operationId": "updatePetWithForm", + "parameters": [ + { + "description": "ID of pet that needs to be updated", + "format": "int64", + "in": "path", + "name": "petId", + "required": true, + "type": "integer" + }, + { + "description": "Updated name of the pet", + "in": "formData", + "name": "name", + "required": false, + "type": "string" + }, + { + "description": "Updated status of the pet", + "in": "formData", + "name": "status", + "required": false, + "type": "string" + } + ], + "produces": [ + "application/xml", + "application/json" + ], + "responses": { + "405": { + "description": "Invalid input" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ], + "summary": "Updates a pet in the store with form data", + "tags": [ + "pet" + ] + } + }, + "/pet/{petId}/uploadImage": { + "post": { + "consumes": [ + "multipart/form-data" + ], + "description": "", + "operationId": "uploadFile", + "parameters": [ + { + "description": "ID of pet to update", + "format": "int64", + "in": "path", + "name": "petId", + "required": true, + "type": "integer" + }, + { + "description": "Additional data to pass to server", + "in": "formData", + "name": "additionalMetadata", + "required": false, + "type": "string" + }, + { + "description": "file to upload", + "in": "formData", + "name": "file", + "required": false, + "type": "file" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/ApiResponse" + } + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ], + "summary": "uploads an image", + "tags": [ + "pet" + ] + } + }, + "/store/inventory": { + "get": { + "description": "Returns a map of status codes to quantities", + "operationId": "getInventory", + "parameters": [], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "additionalProperties": { + "format": "int32", + "type": "integer" + }, + "type": "object" + } + } + }, + "security": [ + { + "api_key": [] + } + ], + "summary": "Returns pet inventories by status", + "tags": [ + "store" + ] + } + }, + "/store/order": { + "post": { + "description": "", + "operationId": "placeOrder", + "parameters": [ + { + "description": "order placed for purchasing the pet", + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Order" + } + } + ], + "produces": [ + "application/xml", + "application/json" + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "400": { + "description": "Invalid Order" + } + }, + "summary": "Place an order for a pet", + "tags": [ + "store" + ] + } + }, + "/store/order/{orderId}": { + "delete": { + "description": "For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors", + "operationId": "deleteOrder", + "parameters": [ + { + "description": "ID of the order that needs to be deleted", + "format": "int64", + "in": "path", + "minimum": 1.0, + "name": "orderId", + "required": true, + "type": "integer" + } + ], + "produces": [ + "application/xml", + "application/json" + ], + "responses": { + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Order not found" + } + }, + "summary": "Delete purchase order by ID", + "tags": [ + "store" + ] + }, + "get": { + "description": "For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions", + "operationId": "getOrderById", + "parameters": [ + { + "description": "ID of pet that needs to be fetched", + "format": "int64", + "in": "path", + "maximum": 10.0, + "minimum": 1.0, + "name": "orderId", + "required": true, + "type": "integer" + } + ], + "produces": [ + "application/xml", + "application/json" + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Order not found" + } + }, + "summary": "Find purchase order by ID", + "tags": [ + "store" + ] + } + }, + "/user": { + "post": { + "description": "This can only be done by the logged in user.", + "operationId": "createUser", + "parameters": [ + { + "description": "Created user object", + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/User" + } + } + ], + "produces": [ + "application/xml", + "application/json" + ], + "responses": { + "default": { + "description": "successful operation" + } + }, + "summary": "Create user", + "tags": [ + "user" + ] + } + }, + "/user/createWithArray": { + "post": { + "description": "", + "operationId": "createUsersWithArrayInput", + "parameters": [ + { + "description": "List of user object", + "in": "body", + "name": "body", + "required": true, + "schema": { + "items": { + "$ref": "#/definitions/User" + }, + "type": "array" + } + } + ], + "produces": [ + "application/xml", + "application/json" + ], + "responses": { + "default": { + "description": "successful operation" + } + }, + "summary": "Creates list of users with given input array", + "tags": [ + "user" + ] + } + }, + "/user/createWithList": { + "post": { + "description": "", + "operationId": "createUsersWithListInput", + "parameters": [ + { + "description": "List of user object", + "in": "body", + "name": "body", + "required": true, + "schema": { + "items": { + "$ref": "#/definitions/User" + }, + "type": "array" + } + } + ], + "produces": [ + "application/xml", + "application/json" + ], + "responses": { + "default": { + "description": "successful operation" + } + }, + "summary": "Creates list of users with given input array", + "tags": [ + "user" + ] + } + }, + "/user/login": { + "get": { + "description": "", + "operationId": "loginUser", + "parameters": [ + { + "description": "The user name for login", + "in": "query", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "The password for login in clear text", + "in": "query", + "name": "password", + "required": true, + "type": "string" + } + ], + "produces": [ + "application/xml", + "application/json" + ], + "responses": { + "200": { + "description": "successful operation", + "headers": { + "X-Expires-After": { + "description": "date in UTC when token expires", + "format": "date-time", + "type": "string" + }, + "X-Rate-Limit": { + "description": "calls per hour allowed by the user", + "format": "int32", + "type": "integer" + } + }, + "schema": { + "type": "string" + } + }, + "400": { + "description": "Invalid username/password supplied" + } + }, + "summary": "Logs user into the system", + "tags": [ + "user" + ] + } + }, + "/user/logout": { + "get": { + "description": "", + "operationId": "logoutUser", + "parameters": [], + "produces": [ + "application/xml", + "application/json" + ], + "responses": { + "default": { + "description": "successful operation" + } + }, + "summary": "Logs out current logged in user session", + "tags": [ + "user" + ] + } + }, + "/user/{username}": { + "delete": { + "description": "This can only be done by the logged in user.", + "operationId": "deleteUser", + "parameters": [ + { + "description": "The name that needs to be deleted", + "in": "path", + "name": "username", + "required": true, + "type": "string" + } + ], + "produces": [ + "application/xml", + "application/json" + ], + "responses": { + "400": { + "description": "Invalid username supplied" + }, + "404": { + "description": "User not found" + } + }, + "summary": "Delete user", + "tags": [ + "user" + ] + }, + "get": { + "description": "", + "operationId": "getUserByName", + "parameters": [ + { + "description": "The name that needs to be fetched. Use user1 for testing. ", + "in": "path", + "name": "username", + "required": true, + "type": "string" + } + ], + "produces": [ + "application/xml", + "application/json" + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/User" + } + }, + "400": { + "description": "Invalid username supplied" + }, + "404": { + "description": "User not found" + } + }, + "summary": "Get user by user name", + "tags": [ + "user" + ] + }, + "put": { + "description": "This can only be done by the logged in user.", + "operationId": "updateUser", + "parameters": [ + { + "description": "name that need to be updated", + "in": "path", + "name": "username", + "required": true, + "type": "string" + }, + { + "description": "Updated user object", + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/User" + } + } + ], + "produces": [ + "application/xml", + "application/json" + ], + "responses": { + "400": { + "description": "Invalid user supplied" + }, + "404": { + "description": "User not found" + } + }, + "summary": "Updated user", + "tags": [ + "user" + ] + } + } + }, + "schemes": [ + "http" + ], + "securityDefinitions": { + "api_key": { + "in": "header", + "name": "api_key", + "type": "apiKey" + }, + "petstore_auth": { + "authorizationUrl": "http://petstore.swagger.io/oauth/dialog", + "flow": "implicit", + "scopes": { + "read:pets": "read your pets", + "write:pets": "modify pets in your account" + }, + "type": "oauth2" + } + }, + "swagger": "2.0", + "tags": [ + { + "description": "Everything about your Pets", + "externalDocs": { + "description": "Find out more", + "url": "http://swagger.io" + }, + "name": "pet" + }, + { + "description": "Access to Petstore orders", + "name": "store" + }, + { + "description": "Operations about user", + "externalDocs": { + "description": "Find out more about our store", + "url": "http://swagger.io" + }, + "name": "user" + } + ] +} \ No newline at end of file diff --git a/restapi/toc.md b/restapi/toc.md new file mode 100644 index 0000000..7bfcb1a --- /dev/null +++ b/restapi/toc.md @@ -0,0 +1,2 @@ +# [Pet Store API](petstore.swagger.json) +# [Contacts API](contacts_swagger2.json) diff --git a/specs/petstore-operations.md b/specs/petstore-operations.md new file mode 100644 index 0000000..8966b35 --- /dev/null +++ b/specs/petstore-operations.md @@ -0,0 +1,23 @@ +--- +uid: petstore.swagger.io/v2/Swagger Petstore/1.0.0 +title: Pet Store APIs +--- + +Describe APIs in Pet Store + +--- +uid: petstore.swagger.io/v2/Swagger Petstore/1.0.0 +title: Pet Store APIs +footer: *content +--- + +### See Alsos +--- +See other REST APIs: +* [Contacts API](../restapi/contacts_swagger2.json) + +--- +uid: petstore.swagger.io/v2/Swagger Petstore/1.0.0/addPet +footer: *content +--- +> NOTE: Add pet only when you needs. diff --git a/toc.yml b/toc.yml index 21a93ae..921b8a2 100644 --- a/toc.yml +++ b/toc.yml @@ -5,3 +5,5 @@ homepage: articles/docfx_getting_started.md - name: API Documentation href: obj/api/ +- name: REST API + href: restapi/