From 925e8285703ddd461588d8f5fbf14bd97c286fab Mon Sep 17 00:00:00 2001 From: Christian Eduardo Palomares Peralta Date: Mon, 13 Dec 2021 23:11:48 -0300 Subject: [PATCH] Schema resource added in REST API Spec for api-version 2021-08-01 (#16715) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adds base for updating Microsoft.ApiManagement from version preview/2021-01-01-preview to version 2021-04-01-preview * Updates readme * Updates API version in new specs and examples * Added support for GraphQL API type (#14851) * Added support for GraphQL API type * Added missing enum value for GraphQL APIs. * add schema definition fix from 2021-01-01-preview (#14883) Co-authored-by: Alan Feng * Vanguard: Get Outbound Network Dependency (#14900) * outbound dependency * fix resource * Update backup/restore API for managed identities (#14973) * Update backup/restore API for system-assigned and user-assigned identities * Fix formatting issue * Rename user-assigned-msi-client-id with client-id * SystemData implemenation on API Management Control Plane (#14899) * system-data * fix spec * remove unreferenced file * APIM - Network Watcher Connectivity Check integration specs (#15056) * Connectivity Check API Specs * Fix * Fix errors * style fixs * Fix 202 code * HTTPConnect request parameters * Fix errors Co-authored-by: Nicolás Barrera * Parameter examples added (#14836) * platformversion (#15114) * fix update service (#15478) * HttpConnect example (#15493) * HttpConnect example * Prettifier fix Co-authored-by: Nicolás Barrera * Rename from SchemaContract to ApiSchemaContract * apimschema.json added to last apim preview version * Completing specification for Schema resource. Fixing changes in SchemaContract. * Value field added to Schema resource specification. * path fixed. Renamed from ApiSchema to Schema. Adding suppression rule to readme.md Custom word added for spellcheck * Fixing PR observations. * Added properties of difference API spec format for "SchemaDocumentProperties" (#15703) * add schema definition fix from 2021-01-01-preview * added properties for SchemaDocumentProperties * updated the fix * updated fix * [APIM]Add private endpoint connection APIs (#15115) * Add private endpoint connection apis * add readme * quick fixes * fix to PE contract * Small fixes * small fixes * small fixes * Small fixes * small fixes * small fix * small fixes * small fixes * small fixes * Update readme.md * fix error * small fix * fix format * address comments * small fixes * Change to lower case * small fixes Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> * Adds base for updating Microsoft.ApiManagement from version preview/2021-04-01-preview to version 2021-08-01 * Updates readme * Updates API version in new specs and examples * Merge main * Modifications to Schema definition to add "description" field. Updating examples of Schema. * Fixing apimanagement.json * Prettier applied in files * Fixing PR comments * fixing x-ms-long-running-operation. * x-ms-long-running-operation : true in apischema. * Removing "Resource" type from apimanagement.json * Apimschema.json updated to point to types.json for ErrorResponse. * Merging from 2021-04-01-preview to 2021-08-01 stable version. * undoing change of responseBody * Updating ErrorResponse. * Fixing definitions merge. * Changing definitions to fix output of examples. * Changes in definitions * Updating response in some examples. * Rolling back ApiSchema -> Schema Schema -> GlobalSchema * Changes to undo apimapis.json and adding prefix for Global example Schemas. * Setting x-ms-long-running-operation-options to location. Co-authored-by: Samir Solanki Co-authored-by: Alexander Zaslonov Co-authored-by: DreamlessA Co-authored-by: Alan Feng Co-authored-by: Jatin Sanghvi <20547963+JatinSanghvi@users.noreply.github.com> Co-authored-by: Nicolás Barrera Co-authored-by: Nicolás Barrera Co-authored-by: VitaliyKurokhtin Co-authored-by: Christian Palomares Co-authored-by: RupengLiu Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> --- .../stable/2021-08-01/apimanagement.json | 21 +- .../stable/2021-08-01/apimschema.json | 331 ++++++++++++++++++ .../stable/2021-08-01/definitions.json | 99 +++++- .../ApiManagementCreateGlobalSchema1.json | 47 +++ .../ApiManagementCreateGlobalSchema2.json | 107 ++++++ .../ApiManagementDeleteGlobalSchema.json | 14 + .../ApiManagementGetGlobalSchema1.json | 23 ++ .../ApiManagementGetGlobalSchema2.json | 43 +++ .../ApiManagementHeadGlobalSchema.json | 16 + .../ApiManagementListGlobalSchemas.json | 58 +++ .../apimanagement/resource-manager/readme.md | 1 + 11 files changed, 743 insertions(+), 17 deletions(-) create mode 100644 specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/apimschema.json create mode 100644 specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGlobalSchema1.json create mode 100644 specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGlobalSchema2.json create mode 100644 specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGlobalSchema.json create mode 100644 specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGlobalSchema1.json create mode 100644 specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGlobalSchema2.json create mode 100644 specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGlobalSchema.json create mode 100644 specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGlobalSchemas.json diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/apimanagement.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/apimanagement.json index 2903909d050f..9a9d03d842f6 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/apimanagement.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/apimanagement.json @@ -607,17 +607,6 @@ "description": "The name of the resource group.", "x-ms-parameter-location": "method" }, - "SchemaIdParameter": { - "name": "schemaId", - "in": "path", - "required": true, - "type": "string", - "description": "Schema identifier within an API. Must be unique in the current API Management service instance.", - "minLength": 1, - "maxLength": 80, - "pattern": "^[^*#&+:<>?]+$", - "x-ms-parameter-location": "method" - }, "ServiceNameParameter": { "name": "serviceName", "in": "path", @@ -765,6 +754,16 @@ "minLength": 1, "maxLength": 80, "x-ms-parameter-location": "method" + }, + "SchemaIdParameter": { + "name": "schemaId", + "in": "path", + "required": true, + "type": "string", + "description": "Schema id identifier. Must be unique in the current API Management service instance.", + "minLength": 1, + "maxLength": 80, + "x-ms-parameter-location": "method" } } } diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/apimschema.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/apimschema.json new file mode 100644 index 000000000000..d071e9d07e30 --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/apimschema.json @@ -0,0 +1,331 @@ +{ + "swagger": "2.0", + "info": { + "title": "ApiManagementClient", + "description": "Use these REST APIs for performing operations on Schema entity in Azure API Management deployment.", + "version": "2021-08-01" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow.", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas": { + "get": { + "tags": [ + "Schema" + ], + "operationId": "GlobalSchema_ListByService", + "description": "Lists a collection of schemas registered with service instance.", + "x-ms-examples": { + "ApiManagementListSchemas": { + "$ref": "./examples/ApiManagementListGlobalSchemas.json" + } + }, + "parameters": [ + { + "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" + }, + { + "name": "$filter", + "in": "query", + "required": false, + "type": "string", + "description": "| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
" + }, + { + "$ref": "./apimanagement.json#/parameters/TopQueryParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SkipQueryParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Lists a collection of Schema entities.", + "schema": { + "$ref": "./definitions.json#/definitions/GlobalSchemaCollection" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-odata": "./definitions.json#/definitions/GlobalSchemaContract" + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}": { + "head": { + "tags": [ + "Schema" + ], + "operationId": "GlobalSchema_GetEntityTag", + "description": "Gets the entity state (Etag) version of the Schema specified by its identifier.", + "x-ms-examples": { + "ApiManagementHeadApi": { + "$ref": "./examples/ApiManagementHeadGlobalSchema.json" + } + }, + "parameters": [ + { + "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SchemaIdParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Specified Schema entity exists and current entity state version is present in the ETag header.", + "headers": { + "ETag": { + "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.", + "type": "string" + } + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } + } + } + }, + "get": { + "tags": [ + "Schema" + ], + "operationId": "GlobalSchema_Get", + "description": "Gets the details of the Schema specified by its identifier.", + "x-ms-examples": { + "ApiManagementGetSchema1": { + "$ref": "./examples/ApiManagementGetGlobalSchema1.json" + }, + "ApiManagementGetSchema2": { + "$ref": "./examples/ApiManagementGetGlobalSchema2.json" + } + }, + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SchemaIdParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "The response body contains the specified Schema entity.", + "schema": { + "$ref": "./definitions.json#/definitions/GlobalSchemaContract" + }, + "headers": { + "ETag": { + "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.", + "type": "string" + } + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "Schema" + ], + "operationId": "GlobalSchema_CreateOrUpdate", + "description": "Creates new or updates existing specified Schema of the API Management service instance.", + "x-ms-examples": { + "ApiManagementCreateSchema1": { + "$ref": "./examples/ApiManagementCreateGlobalSchema1.json" + }, + "ApiManagementCreateSchema2": { + "$ref": "./examples/ApiManagementCreateGlobalSchema2.json" + } + }, + "parameters": [ + { + "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SchemaIdParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "./definitions.json#/definitions/GlobalSchemaContract" + }, + "description": "Create or update parameters." + }, + { + "$ref": "./apimanagement.json#/parameters/IfMatchOptionalParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "201": { + "description": "The new Schema was successfully added.", + "headers": { + "ETag": { + "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.", + "type": "string" + } + }, + "schema": { + "$ref": "./definitions.json#/definitions/GlobalSchemaContract" + } + }, + "200": { + "description": "The Schema details were successfully updated.", + "headers": { + "ETag": { + "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.", + "type": "string" + } + }, + "schema": { + "$ref": "./definitions.json#/definitions/GlobalSchemaContract" + } + }, + "202": { + "description": "Accepted the change when updating the service." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + } + }, + "delete": { + "tags": [ + "Schema" + ], + "operationId": "GlobalSchema_Delete", + "description": "Deletes specific Schema.", + "x-ms-examples": { + "ApiManagementDeleteSchema": { + "$ref": "./examples/ApiManagementDeleteGlobalSchema.json" + } + }, + "parameters": [ + { + "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SchemaIdParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/IfMatchRequiredParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "The Schema was successfully deleted." + }, + "204": { + "description": "The Schema was successfully deleted." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./apimanagement.json#/definitions/ErrorResponse" + } + } + } + } + } + }, + "definitions": {}, + "parameters": {} +} diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/definitions.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/definitions.json index b49a35b974b7..8f7c9e174b96 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/definitions.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/definitions.json @@ -5001,7 +5001,7 @@ "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/SchemaContractProperties", - "description": "Properties of the Schema." + "description": "Properties of the API Schema." } }, "allOf": [ @@ -5009,7 +5009,7 @@ "$ref": "./../../../../../common-types/resource-management/v2/types.json#/definitions/Resource" } ], - "description": "Schema Contract details." + "description": "API Schema Contract details." }, "SchemaContractProperties": { "properties": { @@ -5020,7 +5020,7 @@ "document": { "x-ms-client-flatten": true, "$ref": "#/definitions/SchemaDocumentProperties", - "description": "Create or update Properties of the Schema Document." + "description": "Create or update Properties of the API Schema Document." } }, "required": [ @@ -5036,14 +5036,101 @@ }, "definitions": { "type": "object", - "description": "Types definitions. Used for OpenAPI v2 (Swagger) schemas only, null otherwise." + "description": "Types definitions. Used for Swagger/OpenAPI v1 schemas only, null otherwise." }, "components": { "type": "object", - "description": "Types definitions. Used for OpenAPI v3 schemas only, null otherwise." + "description": "Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only, null otherwise." } }, - "description": "Schema Document Properties." + "description": "Api Schema Document Properties." + }, + "GlobalSchemaCollection": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/GlobalSchemaContract" + }, + "description": "Global Schema Contract value.", + "readOnly": true + }, + "count": { + "type": "integer", + "format": "int64", + "description": "Total record count number." + }, + "nextLink": { + "type": "string", + "description": "Next page link if any.", + "readOnly": true + } + }, + "description": "The response of the list schema operation." + }, + "GlobalSchemaContract": { + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/GlobalSchemaContractProperties", + "description": "Properties of the Global Schema." + } + }, + "allOf": [ + { + "$ref": "./../../../../../common-types/resource-management/v2/types.json#/definitions/Resource" + } + ], + "description": "Global Schema Contract details." + }, + "GlobalSchemaContractProperties": { + "properties": { + "schemaType": { + "type": "string", + "description": "Schema Type. Immutable.", + "enum": [ + "xml", + "json" + ], + "x-ms-client-name": "SchemaType", + "x-ms-enum": { + "name": "SchemaType", + "modelAsString": true, + "values": [ + { + "value": "xml", + "description": "Xml schema type.", + "name": "Xml" + }, + { + "value": "json", + "description": "Json schema type.", + "name": "Json" + } + ] + } + }, + "description": { + "type": "string", + "description": "Free-form schema entity description." + }, + "value": { + "description": "Json-encoded string for non json-based schema." + }, + "document": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/GlobalSchemaDocumentProperties", + "description": "Global Schema document object for json-based schema formats(e.g. json schema)." + } + }, + "required": [ + "schemaType" + ], + "description": "Schema create or update contract Properties." + }, + "GlobalSchemaDocumentProperties": { + "type": "object", + "description": "Global Schema Document Properties." }, "SubscriptionCollection": { "properties": { diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGlobalSchema1.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGlobalSchema1.json new file mode 100644 index 000000000000..ef34ad1f2c6f --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGlobalSchema1.json @@ -0,0 +1,47 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2021-08-01", + "subscriptionId": "subid", + "schemaId": "schema1", + "parameters": { + "properties": { + "description": "sample schema description", + "schemaType": "xml", + "value": "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n" + } + } + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema1?api-version=2021-08-01&asyncId=5c730e343244df1b9cb56e85&asyncCode=201" + } + }, + "201": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema1", + "type": "Microsoft.ApiManagement/service/schemas", + "name": "schema1", + "properties": { + "description": "sample schema description", + "schemaType": "xml", + "value": "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n" + } + } + }, + "200": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema1", + "type": "Microsoft.ApiManagement/service/schemas", + "name": "schema1", + "properties": { + "description": "sample schema description", + "schemaType": "xml", + "value": "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n" + } + } + } + } +} diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGlobalSchema2.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGlobalSchema2.json new file mode 100644 index 000000000000..5942d1fd3852 --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGlobalSchema2.json @@ -0,0 +1,107 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2021-08-01", + "subscriptionId": "subid", + "schemaId": "schema1", + "parameters": { + "properties": { + "description": "sample schema description", + "schemaType": "json", + "document": { + "$id": "https://example.com/person.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Person", + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "The person's first name." + }, + "lastName": { + "type": "string", + "description": "The person's last name." + }, + "age": { + "description": "Age in years which must be equal to or greater than zero.", + "type": "integer", + "minimum": 0 + } + } + } + } + } + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema1?api-version=2021-08-01&asyncId=5c730e343244df1b9cb56e85&asyncCode=201" + } + }, + "201": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema1", + "type": "Microsoft.ApiManagement/service/schemas", + "name": "schema1", + "properties": { + "description": "sample schema description", + "schemaType": "json", + "document": { + "$id": "https://example.com/person.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Person", + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "The person's first name." + }, + "lastName": { + "type": "string", + "description": "The person's last name." + }, + "age": { + "description": "Age in years which must be equal to or greater than zero.", + "type": "integer", + "minimum": 0 + } + } + } + } + } + }, + "200": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema1", + "type": "Microsoft.ApiManagement/service/schemas", + "name": "schema1", + "properties": { + "description": "sample schema description", + "schemaType": "json", + "document": { + "$id": "https://example.com/person.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Person", + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "The person's first name." + }, + "lastName": { + "type": "string", + "description": "The person's last name." + }, + "age": { + "description": "Age in years which must be equal to or greater than zero.", + "type": "integer", + "minimum": 0 + } + } + } + } + } + } + } +} diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGlobalSchema.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGlobalSchema.json new file mode 100644 index 000000000000..fcb01b494eb9 --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGlobalSchema.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2021-08-01", + "subscriptionId": "subid", + "schemaId": "schema1", + "If-Match": "*" + }, + "responses": { + "200": {}, + "204": {} + } +} diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGlobalSchema1.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGlobalSchema1.json new file mode 100644 index 000000000000..bf41871406d3 --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGlobalSchema1.json @@ -0,0 +1,23 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2021-08-01", + "subscriptionId": "subid", + "schemaId": "schema1" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema1", + "type": "Microsoft.ApiManagement/service/schemas", + "name": "schema1", + "properties": { + "description": "sample schema description", + "schemaType": "xml", + "value": "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n" + } + } + } + } +} diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGlobalSchema2.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGlobalSchema2.json new file mode 100644 index 000000000000..df993b696ebc --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGlobalSchema2.json @@ -0,0 +1,43 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2021-08-01", + "subscriptionId": "subid", + "schemaId": "schema2" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema2", + "type": "Microsoft.ApiManagement/service/schemas", + "name": "schema2", + "properties": { + "description": "sample schema description", + "schemaType": "json", + "document": { + "$id": "https://example.com/person.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Person", + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "The person's first name." + }, + "lastName": { + "type": "string", + "description": "The person's last name." + }, + "age": { + "description": "Age in years which must be equal to or greater than zero.", + "type": "integer", + "minimum": 0 + } + } + } + } + } + } + } +} diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGlobalSchema.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGlobalSchema.json new file mode 100644 index 000000000000..1210e40ca6b5 --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGlobalSchema.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2021-08-01", + "subscriptionId": "subid", + "schemaId": "myschema" + }, + "responses": { + "200": { + "headers": { + "etag": "AAAAAAAAAAa=" + } + } + } +} diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGlobalSchemas.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGlobalSchemas.json new file mode 100644 index 000000000000..382414d43044 --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGlobalSchemas.json @@ -0,0 +1,58 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2021-08-01", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema1", + "type": "Microsoft.ApiManagement/service/schemas", + "name": "schema1", + "properties": { + "description": "sample schema description", + "schemaType": "xml", + "value": "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n" + } + }, + { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema2", + "type": "Microsoft.ApiManagement/service/schemas", + "name": "schema2", + "properties": { + "description": "sample schema description", + "schemaType": "json", + "document": { + "$id": "https://example.com/person.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Person", + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "The person's first name." + }, + "lastName": { + "type": "string", + "description": "The person's last name." + }, + "age": { + "description": "Age in years which must be equal to or greater than zero.", + "type": "integer", + "minimum": 0 + } + } + } + } + } + ], + "count": 2, + "nextLink": "" + } + } + } +} diff --git a/specification/apimanagement/resource-manager/readme.md b/specification/apimanagement/resource-manager/readme.md index 07eba9058b41..95f7b6e16885 100644 --- a/specification/apimanagement/resource-manager/readme.md +++ b/specification/apimanagement/resource-manager/readme.md @@ -78,6 +78,7 @@ input-file: - Microsoft.ApiManagement/stable/2021-08-01/apimquotas.json - Microsoft.ApiManagement/stable/2021-08-01/apimregions.json - Microsoft.ApiManagement/stable/2021-08-01/apimreports.json + - Microsoft.ApiManagement/stable/2021-08-01/apimschema.json - Microsoft.ApiManagement/stable/2021-08-01/apimsettings.json - Microsoft.ApiManagement/stable/2021-08-01/apimskus.json - Microsoft.ApiManagement/stable/2021-08-01/apimsubscriptions.json