Skip to content

Commit 1eea731

Browse files
author
Jill Grant
authored
Merge pull request #241767 from dlepow/openapi
[APIM] OpenAPI spec import updates
2 parents 9b89d2e + c403913 commit 1eea731

File tree

7 files changed

+20
-19
lines changed

7 files changed

+20
-19
lines changed

articles/api-management/api-management-api-import-restrictions.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@ When importing an API, you might encounter some restrictions or need to identify
2525
During OpenAPI import, API Management:
2626

2727
* Checks specifically for query string parameters marked as required.
28-
* Converts the query string parameters to template parameters.
28+
* By default, converts the required query string parameters to required template parameters.
2929

30-
If you prefer a different behavior, you can either:
30+
If you prefer that required query parameters in the specification are translated to query parameters in API Management, disable the **Include query parameters in operation templates** setting when creating the API in the portal. You can also accomplish this by using the [APIs - Create or Update](/rest/api/apimanagement/current-ga/apis/create-or-update) REST API to set the API's `translateRequiredQueryParameters` property to `query`.
3131

32-
* Manually change via form-based editor, or
33-
* Remove the "required" attribute from the OpenAPI definition, thus not converting them to template parameters.
3432

3533
For GET, HEAD, and OPTIONS operations, API Management discards a request body parameter if defined in the OpenAPI specification.
3634

articles/api-management/import-and-publish.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
22
title: Tutorial - Import and publish your first API in Azure API Management
3-
description: In this tutorial, you import an OpenAPI Specification API into Azure API Management, and then test your API in the Azure portal.
3+
description: In this tutorial, you import an OpenAPI specification API into Azure API Management, and then test your API in the Azure portal.
44

55
author: dlepow
66
ms.service: api-management
7-
ms.custom: mvc, devdivchpfy22
7+
ms.custom: mvc, devdivchpfy22, engagement-fy23
88
ms.topic: tutorial
9-
ms.date: 12/10/2021
9+
ms.date: 06/15/2023
1010
ms.author: danlep
1111

1212
---
1313
# Tutorial: Import and publish your first API
1414

15-
This tutorial shows how to import an OpenAPI Specification backend API in JSON format into Azure API Management. Microsoft provides the backend API used in this example, and hosts it on Azure at [https://conferenceapi.azurewebsites.net?format=json](https://conferenceapi.azurewebsites.net?format=json).
15+
This tutorial shows how to import an OpenAPI specification backend API in JSON format into Azure API Management. Microsoft provides the backend API used in this example, and hosts it on Azure at `https://conferenceapi.azurewebsites.net`.
1616

1717
Once you import the backend API into API Management, your API Management API becomes a façade for the backend API. You can customize the façade to your needs in API Management without touching the backend API. For more information, see [Transform and protect your API](transform-api.md).
1818

@@ -24,7 +24,7 @@ In this tutorial, you learn how to:
2424
2525
After import, you can manage the API in the Azure portal.
2626

27-
:::image type="content" source="media/import-and-publish/created-api-1.png" alt-text="New API in API Management":::
27+
:::image type="content" source="media/import-and-publish/created-api.png" alt-text="Screenshot of a new API in API Management in the portal.":::
2828

2929
## Prerequisites
3030

@@ -35,7 +35,7 @@ After import, you can manage the API in the Azure portal.
3535

3636
## Import and publish a backend API
3737

38-
This section shows how to import and publish an OpenAPI Specification backend API.
38+
This section shows how to import and publish an OpenAPI specification backend API.
3939

4040
1. In the left navigation of your API Management instance, select **APIs**.
4141
1. Select the **OpenAPI** tile.
@@ -44,19 +44,20 @@ This section shows how to import and publish an OpenAPI Specification backend AP
4444

4545
You can set API values during creation or later by going to the **Settings** tab.
4646

47-
:::image type="content" source="media/import-and-publish/open-api-specs.png" alt-text="Create an API":::
47+
:::image type="content" source="media/import-and-publish/open-api-specs.png" alt-text="Screenshot of creating an API in the portal.":::
4848

4949

5050
|Setting|Value|Description|
5151
|-------|-----|-----------|
52-
|**OpenAPI specification**|*https:\//conferenceapi.azurewebsites.net?format=json*|Specifies the backend service implementing the API. API Management forwards requests to this address. <br/><br/>The backend service URL appears later as the **Web service URL** on the API's **Settings** page. |
53-
|**Display name**|After you enter the preceding service URL, API Management fills out this field based on the JSON.|The name displayed in the [developer portal](api-management-howto-developer-portal.md).|
54-
|**Name**|After you enter the preceding service URL, API Management fills out this field based on the JSON.|A unique name for the API.|
55-
|**Description**|After you enter the preceding service URL, API Management fills out this field based on the JSON.|An optional description of the API.|
52+
|**OpenAPI specification**|*https:\//conferenceapi.azurewebsites.net?format=json*|Specifies the backend service implementing the API and the operations that the API supports. <br/><br/>The backend service URL appears later as the **Web service URL** on the API's **Settings** page.<br/><br/>After import, you can add, edit, rename, or delete operations in the specification. |
53+
| **Include query parameters in operation templates** | Selected (default) | Specifies whether to import required query parameters in the specification as template parameters in API Management. |
54+
|**Display name**|After you enter the OpenAPI specification URL, API Management fills out this field based on the JSON.|The name displayed in the [developer portal](api-management-howto-developer-portal.md).|
55+
|**Name**|After you enter the OpenAPI specification URL, API Management fills out this field based on the JSON.|A unique name for the API.|
56+
|**Description**|After you enter the OpenAPI specification URL, API Management fills out this field based on the JSON.|An optional description of the API.|
5657
|**URL scheme**|**HTTPS**|Which protocols can access the API.|
5758
|**API URL suffix**|*conference*|The suffix appended to the base URL for the API Management service. API Management distinguishes APIs by their suffix, so the suffix must be unique for every API for a given publisher.|
5859
|**Tags**| |Tags for organizing APIs for searching, grouping, or filtering.|
59-
|**Products**|**Unlimited**|Association of one or more APIs. Each API Management instance comes with two sample products: **Starter** and **Unlimited**. You publish an API by associating the API with a product, **Unlimited** in this example.<br/><br/> You can include several APIs in a product and offer them to developers through the developer portal. To add this API to another product, type or select the product name. Repeat this step to add the API to multiple products. You can also add APIs to products later from the **Settings** page.<br/><br/> For more information about products, see [Create and publish a product](api-management-howto-add-products.md).|
60+
|**Products**|**Unlimited**|Association of one or more APIs. Each API Management instance comes with two sample products: **Starter** and **Unlimited**. You publish an API by associating the API with a product, **Unlimited** in this example.<br/><br/> You can include several APIs in a product and offer product [subscriptions](api-management-subscriptions.md) to developers through the developer portal. To add this API to another product, type or select the product name. Repeat this step to add the API to multiple products. You can also add APIs to products later from the **Settings** page.<br/><br/> For more information about products, see [Create and publish a product](api-management-howto-add-products.md).|
6061
|**Gateways**|**Managed**|API gateway(s) that expose the API. This field is available only in **Developer** and **Premium** tier services.<br/><br/>**Managed** indicates the gateway built into the API Management service and hosted by Microsoft in Azure. [Self-hosted gateways](self-hosted-gateway-overview.md) are available only in the Premium and Developer service tiers. You can deploy them on-premises or in other clouds.<br/><br/> If no gateways are selected, the API won't be available and your API requests won't succeed.|
6162
|**Version this API?**|Select or deselect|For more information, see [Publish multiple versions of your API](api-management-get-started-publish-versions.md).|
6263

@@ -69,13 +70,15 @@ If you have problems importing an API definition, see the [list of known issues
6970

7071
## Test the new API in the Azure portal
7172

72-
You can call API operations directly from the Azure portal, which provides a convenient way to view and test the operations.
73+
You can call API operations directly from the Azure portal, which provides a convenient way to view and test the operations. In the portal's test console, by default, APIs are called by using a key from the built-in all-access subscription. You can also test API calls by using a subscription key scoped to a product.
7374

7475
1. In the left navigation of your API Management instance, select **APIs** > **Demo Conference API**.
75-
1. Select the **Test** tab, and then select **GetSpeakers**. The page shows **Query parameters** and **Headers**, if any. The **Ocp-Apim-Subscription-Key** is filled in automatically for the subscription key associated with this API.
76+
1. Select the **Test** tab, and then select **GetSpeakers**. The page shows **Query parameters** and **Headers**, if any.
77+
78+
In the **HTTP request** section, the **Ocp-Apim-Subscription-Key** header is filled in automatically for you, which you can see if you select the "eye" icon.
7679
1. Select **Send**.
7780

78-
:::image type="content" source="media/import-and-publish/test-new-api.png" alt-text="Test API in Azure portal":::
81+
:::image type="content" source="media/import-and-publish/test-new-api.png" alt-text="Screenshot of testing an API in Azure portal." lightbox="media/import-and-publish/test-new-api.png":::
7982

8083
The backend responds with **200 OK** and some data.
8184

Binary file not shown.
Binary file not shown.
27 KB
Loading
4.86 KB
Loading
2.46 KB
Loading

0 commit comments

Comments
 (0)