Partager via


Api Schema - List By Api

Get the schema configuration at the API level.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas?api-version=2021-08-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas?$filter={$filter}&$top={$top}&$skip={$skip}&api-version=2021-08-01

URI Parameters

Name In Required Type Description
apiId
path True

string

API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.

Regex pattern: ^[^*#&+:<>?]+$

resourceGroupName
path True

string

The name of the resource group.

serviceName
path True

string

The name of the API Management service.

Regex pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

subscriptionId
path True

string

Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

api-version
query True

string

Version of the API to be used with the client request.

$filter
query

string

| Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| contentType | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |

$skip
query

integer

int32

Number of records to skip.

$top
query

integer

int32

Number of records to return.

Responses

Name Type Description
200 OK

SchemaCollection

Apis Schema Collection.

Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

ApiManagementListApiSchemas

Sample request

GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/59d5b28d1f7fab116c282650/schemas?api-version=2021-08-01

Sample response

{
  "value": [
    {
      "id": "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/59d5b28d1f7fab116c282650/schemas/59d5b28e1f7fab116402044e",
      "type": "Microsoft.ApiManagement/service/apis/schemas",
      "name": "59d5b28e1f7fab116402044e",
      "properties": {
        "contentType": "application/vnd.ms-azure-apim.swagger.definitions+json"
      }
    }
  ],
  "count": 1,
  "nextLink": ""
}

Definitions

Name Description
ErrorFieldContract

Error Field contract.

ErrorResponse

Error Response.

SchemaCollection

The response of the list schema operation.

SchemaContract

API Schema Contract details.

ErrorFieldContract

Error Field contract.

Name Type Description
code

string

Property level error code.

message

string

Human-readable representation of property-level error.

target

string

Property name.

ErrorResponse

Error Response.

Name Type Description
error.code

string

Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.

error.details

ErrorFieldContract[]

The list of invalid fields send in request, in case of validation error.

error.message

string

Human-readable representation of the error.

SchemaCollection

The response of the list schema operation.

Name Type Description
count

integer

Total record count number.

nextLink

string

Next page link if any.

value

SchemaContract[]

API Schema Contract value.

SchemaContract

API Schema Contract details.

Name Type Description
id

string

Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

The name of the resource

properties.contentType

string

Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml).
- Swagger Schema use application/vnd.ms-azure-apim.swagger.definitions+json
- WSDL Schema use application/vnd.ms-azure-apim.xsd+xml
- OpenApi Schema use application/vnd.oai.openapi.components+json
- WADL Schema use application/vnd.ms-azure-apim.wadl.grammars+xml.

properties.document.components

object

Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only, null otherwise.

properties.document.definitions

object

Types definitions. Used for Swagger/OpenAPI v1 schemas only, null otherwise.

properties.document.value

string

Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"