Skip to content

Commit 01ecdf5

Browse files
author
gitName
committed
[APIM] Import OAS
1 parent 99e73ac commit 01ecdf5

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

articles/api-management/import-api-from-oas.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ author: dlepow
66

77
ms.service: azure-api-management
88
ms.topic: how-to
9-
ms.date: 10/26/2022
9+
ms.date: 11/27/2024
1010
ms.author: danlep
1111
ms.custom: engagement-fy23, devx-track-azurepowershell, devx-track-azurecli
1212
---
1313
# Import an OpenAPI specification
1414

1515
[!INCLUDE [api-management-availability-all-tiers](../../includes/api-management-availability-all-tiers.md)]
1616

17-
This article shows how to import an "OpenAPI specification" backend API residing at `https://conferenceapi.azurewebsites.net?format=json`. This backend API is provided by Microsoft and hosted on Azure. The article also shows how to test the APIM API.
17+
This article shows how to import an "OpenAPI specification" backend API to Azure API Management using a variety of tools. The article also shows how to test the API in API Management.
1818

1919
In this article, you learn how to:
2020
> [!div class="checklist"]
@@ -37,6 +37,9 @@ In this article, you learn how to:
3737

3838
## <a name="create-api"> </a>Import a backend API
3939

40+
For this example, you import the [specification](https://petstore3.swagger.io/api/v3/openapi.json) for the open source [Petstore API](https://petstore3.swagger.io/), but you can substitute an OpenAPI specification of your choice.
41+
42+
4043
#### [Portal](#tab/portal)
4144

4245
1. In the [Azure portal](https://portal.azure.com), navigate to your API Management instance.
@@ -57,10 +60,10 @@ APIMServiceName="apim-hello-world"
5760
ResourceGroupName="myResourceGroup"
5861
5962
# API-specific details
60-
APIId="demo-conference-api"
61-
APIPath="conference"
63+
APIId="swagger-petstore"
64+
APIPath="store"
6265
SpecificationFormat="OpenAPI"
63-
SpecificationURL="https://conferenceapi.azurewebsites.net/?format=json"
66+
SpecificationURL="https://petstore3.swagger.io/api/v3/openapi.json"
6467
6568
# Import API
6669
az apim api import --path $APIPath --resource-group $ResourceGroupName \
@@ -80,10 +83,10 @@ $apimServiceName = "apim-hello-world"
8083
$resourceGroupName = "myResourceGroup"
8184
8285
# API-specific details
83-
$apiId = "demo-conference-api"
84-
$apiPath = "conference"
86+
$apiId = "swagger-petstore"
87+
$apiPath = "store"
8588
$specificationFormat = "OpenAPI"
86-
$specificationUrl = "https://conferenceapi.azurewebsites.net/?format=json"
89+
$specificationUrl = "https://petstore3.swagger.io/api/v3/openapi.json"
8790
8891
# Get context of the API Management instance.
8992
$context = New-AzApiManagementContext -ResourceGroupName $resourceGroupName -ServiceName $apimServiceName
@@ -102,7 +105,7 @@ After importing the API, if needed, you can update the settings by using the [Se
102105

103106
[!INCLUDE [api-management-define-api-topics.md](../../includes/api-management-define-api-topics.md)]
104107

105-
## Validate against an OpenAPI specification
108+
## Validate against an OpenAPI specification schema
106109

107110
You can configure API Management [validation policies](api-management-policies.md#content-validation) to validate requests and responses (or elements of them) against the schema in an OpenAPI specification. For example, use the [validate-content](validate-content-policy.md) policy to validate the size or content of a request or response body.
108111

0 commit comments

Comments
 (0)