You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/api-center/enable-managed-api-analysis-linting.md
+16-29Lines changed: 16 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Managed API linting and analysis - Azure API Center
3
3
description: Enable managed linting of API definitions in your API center to analyze compliance of APIs with the organization's API style guide.
4
4
ms.service: azure-api-center
5
5
ms.topic: how-to
6
-
ms.date: 08/22/2024
6
+
ms.date: 08/23/2024
7
7
ms.author: danlep
8
8
author: dlepow
9
9
ms.custom:
@@ -37,18 +37,18 @@ In this scenario:
37
37
38
38
* The following Visual Studio Code extensions:
39
39
*[Azure API Center extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=apidev.azure-api-center)
40
-
*[Spectral extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=stoplight.spectral)
41
40
42
-
> [!NOTE]
43
-
> Enable managed API analysis using the API Center extension's pre-release version. When installing the extension, choose the pre-release version. Switch between release and pre-release versions any time via the extension's **Manage** button in the Extensions view.
41
+
> [!IMPORTANT]
42
+
> Enable managed API analysis using the API Center extension's pre-release version. When installing the extension, choose the pre-release version. Switch between release and pre-release versions any time via the extension's **Manage** button in the Extensions view.
43
+
*[Spectral extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=stoplight.spectral)
44
44
45
45
## Enable API analysis using Visual Studio Code
46
46
47
47
To enable API analysis using the default linting ruleset:
48
48
49
-
1. In Visual Studio Code, open a folder that you will use to manage rulesets for Azure API Center.
49
+
1. In Visual Studio Code, open a folder that you'll use to manage rulesets for Azure API Center.
50
50
1. Select the Azure API Center icon from the Activity Bar.
51
-
1. In the Explorer pane, expand the API center resource in which to enable API analysis.
51
+
1. In the API Center pane, expand the API center resource in which to enable API analysis.
52
52
1. Right-click **Rules** and select **Enable API Analysis**.
53
53
54
54
:::image type="content" source="media/enable-managed-api-analysis-linting/enable-analysis-visual-studio-code.png" alt-text="Screenshot of enabling API linting and analysis in Visual Studio Code.":::
@@ -62,34 +62,21 @@ With analysis enabled, the linting engine analyzes API definitions in your API c
62
62
63
63
## View API analysis reports
64
64
65
-
View the analysis reports for your API definitions in the Azure portal. After an API definition is analyzed, the report lists errors, warnings, and information based on the configured API style guide.
66
-
67
-
In the portal, you can also view a summary of analysis reports for all API definitions in your API center.
68
-
69
-
### Analysis report for an API definition
70
-
71
-
To view the analysis report for an API definition in your API center:
72
-
73
-
1. In the portal, navigate to an API version in your API center where you have added or updated an API definition.
74
-
1. In the left menu, under **Details**, select **Definitions**.
75
-
1. Select the API definition.
76
-
1. Select the **Analysis** tab.
77
-
:::image type="content" source="media/enable-api-analysis-linting/analyze-api-definition.png" alt-text="Screenshot of Analysis tab for API definition in the portal." :::
65
+
View an analysis summary and the analysis reports for your API definitions in the Azure portal. After API definitions are analyzed, the reports list errors, warnings, and information based on the configured API style guide.
78
66
79
-
The **API Analysis Report** opens, and it displays the API definition and errors, warnings, and information based on the configured API style guide. The following screenshot shows an example of an API analysis report.
80
-
81
-
:::image type="content" source="media/enable-api-analysis-linting/api-analysis-report.png" alt-text="Screenshot of an API analysis report in the portal." lightbox="media/enable-api-analysis-linting/api-analysis-report.png":::
82
-
83
-
### API analysis summary
84
-
85
-
To view a summary of analysis reports for all API definitions in your API center:
67
+
To view an analysis summary in your API center:
86
68
87
69
1. In the portal, navigate to your API center.
88
70
1. In the left-hand menu, under **Governance**, select **API Analysis**. The summary appears.
89
71
90
72
:::image type="content" source="media/enable-api-analysis-linting/api-analysis-summary.png" alt-text="Screenshot of the API analysis summary in the portal." lightbox="media/enable-api-analysis-linting/api-analysis-summary.png":::
91
73
92
-
Optionally select the API Analysis Report icon to view the detailed analysis report for an API definition.
74
+
1. Optionally select the API Analysis Report icon for an API definition. The definition's API analysis report appears, as shown in the following screenshot.
75
+
76
+
:::image type="content" source="media/enable-api-analysis-linting/api-analysis-report.png" alt-text="Screenshot of an API analysis report in the portal." lightbox="media/enable-api-analysis-linting/api-analysis-report.png":::
77
+
78
+
> [!TIP]
79
+
> You can also view the API analysis report by selecting **Analysis** from the API definition's menu bar.
93
80
94
81
## Customize ruleset
95
82
@@ -112,7 +99,7 @@ Before deploying the custom ruleset to your API center, validate it locally. The
112
99
113
100
This step makes the custom ruleset the active API style guide for linting.
114
101
115
-
Now, when you an OpenAPI-based API definition file, a local linting operation is automatically triggered in Visual Studio Code. Results are displayed inline in the editor and in the **Problems** window (**View > Problems** or **Ctrl+Shift+M**).
102
+
Now, when you open an OpenAPI-based API definition file, a local linting operation is automatically triggered in Visual Studio Code. Results are displayed inline in the editor and in the **Problems** window (**View > Problems** or **Ctrl+Shift+M**).
116
103
117
104
:::image type="content" source="media/enable-managed-api-analysis-linting/validate-local-linting.png" alt-text="Screenshot of linting an API definition in Visual Studio Code." lightbox="media/enable-managed-api-analysis-linting/validate-local-linting.png":::
118
105
@@ -128,7 +115,7 @@ To deploy the custom ruleset to your API center:
128
115
129
116
A message notifies you after the rules are successfully deployed to your API center. The linting engine uses the updated ruleset to analyze API definitions.
130
117
131
-
View the API analysis reports in the portal to see the results of linting with the updated ruleset.
118
+
To see the results of linting with the updated ruleset, view the API analysis reports in the portal.
0 commit comments