From 3d2e43a74af3670fec011540bb55ac1523f3ed59 Mon Sep 17 00:00:00 2001 From: Alexander Zaslonov Date: Wed, 16 Jun 2021 19:20:39 -0700 Subject: [PATCH] Added support for GraphQL API type (#14851) * Added support for GraphQL API type * Added missing enum value for GraphQL APIs. --- azure-rest-api-specs | 1 + .../preview/2021-04-01-preview/apimapis.json | 3 + .../2021-04-01-preview/definitions.json | 24 ++++-- .../ApiManagementCreateGraphQLApi.json | 75 +++++++++++++++++++ 4 files changed, 97 insertions(+), 6 deletions(-) create mode 160000 azure-rest-api-specs create mode 100644 specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementCreateGraphQLApi.json diff --git a/azure-rest-api-specs b/azure-rest-api-specs new file mode 160000 index 000000000000..c6c46a85babe --- /dev/null +++ b/azure-rest-api-specs @@ -0,0 +1 @@ +Subproject commit c6c46a85babe68ad27f626bc40007e1556ec8fa1 diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/apimapis.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/apimapis.json index 559ab0d8b260..34cce37bd923 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/apimapis.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/apimapis.json @@ -259,6 +259,9 @@ }, "ApiManagementCreateApiUsingImportOverrideServiceUrl": { "$ref": "./examples/ApiManagementCreateApiUsingImportOverrideServiceUrl.json" + }, + "ApiManagementCreateGraphQLApi": { + "$ref": "./examples/ApiManagementCreateGraphQLApi.json" } }, "parameters": [ diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/definitions.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/definitions.json index 434f4c697744..939373ed9cdc 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/definitions.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/definitions.json @@ -333,7 +333,8 @@ "openapi", "openapi+json", "openapi-link", - "openapi+json-link" + "openapi+json-link", + "graphql-link" ], "x-ms-enum": { "name": "ContentFormat", @@ -378,6 +379,10 @@ { "value": "openapi+json-link", "description": "The OpenAPI 3.0 JSON document is hosted on a publicly accessible internet address." + }, + { + "value": "graphql-link", + "description": "The GraphQL API endpoint hosted on a publicly accessible internet address." } ] } @@ -398,11 +403,12 @@ }, "apiType": { "type": "string", - "description": "Type of API to create. \n * `http` creates a REST API \n * `soap` creates a SOAP pass-through API \n * `websocket` creates websocket API.", + "description": "Type of API to create. \n * `http` creates a REST API \n * `soap` creates a SOAP pass-through API \n * `websocket` creates websocket API \n * `graphql` creates GraphQL API.", "enum": [ "http", "soap", - "websocket" + "websocket", + "graphql" ], "x-ms-client-name": "SoapApiType", "x-ms-enum": { @@ -416,13 +422,18 @@ }, { "value": "soap", - "description": "Imports the Soap API having a SOAP front end.", + "description": "Imports the SOAP API having a SOAP front end.", "name": "SoapPassThrough" }, { "value": "websocket", - "description": "Imports the Soap API having a Websocket front end.", + "description": "Imports the API having a Websocket front end.", "name": "WebSocket" + }, + { + "value": "graphql", + "description": "Imports the API having a GraphQL front end.", + "name": "GraphQL" } ] } @@ -455,7 +466,8 @@ "enum": [ "http", "soap", - "websocket" + "websocket", + "graphql" ], "x-ms-client-name": "ApiType", "x-ms-enum": { diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementCreateGraphQLApi.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementCreateGraphQLApi.json new file mode 100644 index 000000000000..05bf1bdc1763 --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2021-04-01-preview/examples/ApiManagementCreateGraphQLApi.json @@ -0,0 +1,75 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2021-04-01-preview", + "subscriptionId": "subid", + "apiId": "tempgroup", + "parameters": { + "properties": { + "description": "apidescription5200", + "displayName": "apiname1463", + "type": "graphql", + "serviceUrl": "https://api.spacex.land/graphql", + "path": "graphql-api", + "protocols": [ + "http", + "https" + ] + } + } + }, + "responses": { + "201": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/apiid9419", + "type": "Microsoft.ApiManagement/service/apis", + "name": "apiid9419", + "properties": { + "displayName": "apiname1463", + "apiRevision": "1", + "description": "apidescription5200", + "serviceUrl": "https://api.spacex.land/graphql", + "type": "graphql", + "path": "graphql-api", + "protocols": [ + "https", + "https" + ], + "authenticationSettings": null, + "subscriptionKeyParameterNames": null, + "isCurrent": true, + "isOnline": true + } + } + }, + "202": { + "headers": { + "location": "https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/tempgroup?api-version=2021-04-01-preview&asyncId=5c730e343244df1b9cb56e85&asyncCode=201" + } + }, + "200": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/apiid9419", + "type": "Microsoft.ApiManagement/service/apis", + "name": "apiid9419", + "properties": { + "displayName": "apiname1463", + "apiRevision": "1", + "description": "apidescription5200", + "serviceUrl": "https://api.spacex.land/graphql", + "type": "graphql", + "path": "graphql-api", + "protocols": [ + "http", + "https" + ], + "authenticationSettings": null, + "subscriptionKeyParameterNames": null, + "isCurrent": true, + "isOnline": true + } + } + } + } +}