Skip to content

Commit 9733559

Browse files
authored
Merge pull request #175471 from v-hhunter/hannah-1879111-importrestrictionsfreshness
[APIM] import restrictions freshness and issues
2 parents 8584b36 + 03bb767 commit 9733559

File tree

1 file changed

+127
-65
lines changed

1 file changed

+127
-65
lines changed

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

Lines changed: 127 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,27 @@ ms.service: api-management
1313
ms.workload: mobile
1414
ms.tgt_pltfrm: na
1515
ms.topic: article
16-
ms.date: 09/24/2021
16+
ms.date: 10/26/2021
1717
ms.author: danlep
1818
---
1919

2020
# API import restrictions and known issues
2121

22-
## About this list
23-
2422
When importing an API, you might encounter some restrictions or need to identify and rectify issues before you can successfully import. In this article, you'll learn:
25-
* All the limitations, organized by the import format of the API.
23+
* API Management's behavior during OpenAPI import.
24+
* Import limitations, organized by the import format of the API.
2625
* How OpenAPI export works.
2726

27+
## API Management during OpenAPI import
28+
29+
During OpenAPI import, API Management:
30+
* Checks specifically for query string parameters marked as required.
31+
* Converts the query string parameters to template parameters.
32+
33+
If you prefer a different behavior, you can either:
34+
* Manually change via form-based editor, or
35+
* Remove the "required" attribute from the OpenAPI definition, thus not converting them to template parameters.
36+
2837
## <a name="open-api"> </a>OpenAPI/Swagger import limitations
2938

3039
If you receive errors while importing your OpenAPI document, make sure you've validated it beforehand by either:
@@ -33,44 +42,85 @@ If you receive errors while importing your OpenAPI document, make sure you've va
3342

3443
### <a name="open-api-general"> </a>General
3544

36-
- Required parameters across both path and query must have unique names.
37-
- In OpenAPI, a parameter name only needs to be unique within a location, for example path, query, header.
38-
- In API Management, we allow operations to be discriminated by both path and query parameters.
39-
- Since OpenAPI doesn't support this, we require parameter names to be unique within the entire URL template.
40-
- When imported inline to API Management, an OpenAPI specification can be up to 4 MB in size.
41-
- The size limit doesn't apply when an OpenAPI document is provided via a URL to a location accessible from your API Management service.
42-
- `\$ref` pointers can't reference external files.
43-
- The only supported extensions are:
44-
- `x-ms-paths`
45-
- `x-servers`
46-
- Custom extensions:
47-
- Ignored on import.
48-
- Aren't saved or preserved for export.
49-
- Security definitions are ignored.
50-
- `Recursion`:
51-
- API Management doesn't support definitions defined recursively.
52-
- For example, schemas referring to themselves.
53-
- `server` object isn't supported on the API operation level.
54-
- `Produces` keyword (which describes MIME types returned by an API) isn't supported.
55-
- Available source file URL is applied to relative server URLs.
56-
- Inline schema definitions for API operations aren't supported. Schema definitions:
57-
- Are defined in the API scope.
58-
- Can be referenced in API operations request or response scopes.
59-
- A defined URL parameter needs to be part of the URL template.
45+
#### URL template requirements
46+
47+
| Requirement | Description |
48+
| ----------- | ----------- |
49+
| **Unique names for required path and query parameters** | In OpenAPI: <ul><li>A parameter name only needs to be unique within a location, for example path, query, header.</li></ul>In API Management:<ul><li>We allow operations to be discriminated by both path and query parameters.</li><li>OpenAPI doesn't support this discrimination, so we require parameter names to be unique within the entire URL template.</li></ul> |
50+
| **Defined URL parameter** | Must be part of the URL template. |
51+
| **Available source file URL** | Applied to relative server URLs. |
52+
| **`\$ref` pointers** | Can't reference external files. |
53+
54+
55+
#### OpenAPI specifications
56+
57+
**Supported versions**
58+
59+
API Management only supports:
60+
* OpenAPI version 2.
61+
* OpenAPI version 3.0.x (up to version 3.0.3).
62+
63+
OpenAPI version 3.1 is currently not supported in API Management.
64+
65+
**Size limitations**
66+
67+
| Size limit | Description |
68+
| ---------- | ----------- |
69+
| **Up to 4 MB** | When an OpenAPI specification is imported inline to API Management. |
70+
| **Size limit doesn't apply** | When an OpenAPI document is provided via a URL to a location accessible from your API Management service. |
71+
72+
#### Supported extensions
73+
The only supported extensions are:
74+
75+
| Extension | Description |
76+
| ----------- | ----------- |
77+
| **`x-ms-paths`** | <ul><li>Allows you to define paths that are differentiated by query parameters in the URL.</li><li>Covered in the [AutoRest docs](https://github.com/Azure/autorest/tree/main/docs/extensions#x-ms-paths).</li></ul> |
78+
| **`x-servers`** | A backport of the [OpenAPI 3 `servers` object](https://swagger.io/docs/specification/api-host-and-base-path/) for OpenAPI 2. |
79+
80+
#### Unsupported extensions
81+
| Extension | Description |
82+
| ----------- | ----------- |
83+
| **`Recursion`** | API Management doesn't support definitions defined recursively.<br />For example, schemas referring to themselves. |
84+
| **`Server` object** | Not supported on the API operation level. |
85+
| **`Produces` keyword** | Describes MIME types returned by an API. <br />Not supported. |
86+
87+
#### Custom extensions
88+
- Are ignored on import.
89+
- Aren't saved or preserved for export.
90+
91+
#### Unsupported definitions
92+
Inline schema definitions for API operations aren't supported. Schema definitions:
93+
- Are defined in the API scope.
94+
- Can be referenced in API operations request or response scopes.
95+
96+
#### Ignored definitions
97+
Security definitions are ignored.
6098

6199
### <a name="open-api-v2"> </a>OpenAPI version 2
62100

63101
OpenAPI version 2 support is limited to JSON format only.
64102

65-
### <a name="open-api-v3"> </a>OpenAPI version 3
103+
### <a name="open-api-v3"> </a>OpenAPI version 3.0.x
66104

67-
- If multiple `servers` are specified, API Management will use the first HTTPS URL it finds.
105+
The latest supported OpenAPI version 3.0 is 3.0.3.
106+
107+
#### HTTPS URLs
108+
- If multiple `servers` are specified, API Management will use the first HTTPS URL it finds.
68109
- If there aren't any HTTPS URLs, the server URL will be empty.
69-
- `Examples` isn't supported, but `example` is.
70-
- The following fields are included in OpenAPI version 3.x, but are not supported:
71-
- `explode`
72-
- `style`
73-
- `allowReserved`
110+
111+
#### Supported
112+
- `example`
113+
114+
#### Unsupported
115+
The following fields are included in [OpenAPI version 3.0.x](https://swagger.io/specification/), but are not supported:
116+
117+
| Object | Field |
118+
| ----------- | ----------- |
119+
| **OpenAPI** | `externalDocs` |
120+
| **Components** | <ul><li>`responses`</li><li>`parameters`</li><li>`examples`</li><li>`requestBodies`</li><li>`headers`</li><li>`securitySchemes`</li><li>`links`</li><li>`callbacks`</li></ul> |
121+
| **PathItem** | <ul><li>`trace`</li><li>`servers`</li></ul> |
122+
| **Operation** | <ul><li>`externalDocs`</li><li>`callbacks`</li><li>`security`</li><li>`servers`</li></ul> |
123+
| **Parameter** | <ul><li>`allowEmptyValue`</li><li>`style`</li><li>`explode`</li><li>`allowReserved`</li></ul> |
74124

75125
## OpenAPI import, update, and export mechanisms
76126

@@ -80,15 +130,21 @@ API definitions exported from an API Management service are:
80130
* Primarily intended for external applications that need to call the API hosted in API Management service.
81131
* Not intended to be imported into the same or different API Management service.
82132

83-
For configuration management of API definitions across different services/environments, please refer to documentation regarding using API Management Service with Git.
133+
For configuration management of API definitions across different services/environments, refer to documentation regarding using API Management service with Git.
84134

85135
### Add new API via OpenAPI import
86136

87-
For each operation found in the OpenAPI document, a new operation will be created with Azure resource name and display name set to `operationId` and `summary`, respectively.
88-
* `operationId` value is normalized.
89-
* If `operationId` isn't specified (not present, `null`, or empty), Azure resource name value will be generated by combining HTTP method and path template, for example, `get-foo`.
90-
* `summary` value is imported as-is and its length is limited to 300 characters.
91-
* If `summary` isn't specified (not present, `null`, or empty), `display name` value will set to `operationId`.
137+
For each operation found in the OpenAPI document, a new operation will be created with:
138+
* Azure resource name set to `operationId`.
139+
* `operationId` value is normalized.
140+
* If `operationId` isn't specified (not present, `null`, or empty), Azure resource name value will be generated by combining HTTP method and path template.
141+
* For example, `get-foo`.
142+
143+
* Display name set to `summary`.
144+
* `summary` value:
145+
* Imported as-is.
146+
* Length is limited to 300 characters.
147+
* If `summary` isn't specified (not present, `null`, or empty), display name value will set to `operationId`.
92148

93149
### Update an existing API via OpenAPI import
94150

@@ -110,7 +166,7 @@ To make import more predictable, follow these guidelines:
110166

111167
### Export API as OpenAPI
112168

113-
Each operation's:
169+
For each operation, its:
114170
* Azure resource name will be exported as an `operationId`.
115171
* Display name will be exported as a `summary`.
116172

@@ -127,29 +183,35 @@ Each operation's:
127183

128184
You can create SOAP pass-through and SOAP-to-REST APIs with WSDL files.
129185

130-
- **SOAP bindings**
131-
- Only SOAP bindings of "document" and “literal” encoding style are supported.
132-
- No support for “rpc” style or SOAP-Encoding.
133-
- **WSDL:Import**
134-
- Not supported. Instead, merge the imports into one document.
135-
- **Messages with multiple parts**
136-
- This message type is not supported.
137-
- **WCF wsHttpBinding**
138-
- SOAP services created with Windows Communication Foundation should use `basicHttpBinding`.
139-
- `wsHttpBinding` isn't supported.
140-
- **MTOM**
141-
- Services using `MTOM` *may* work.
142-
- Official support isn't offered at this time.
143-
- **Recursion**
144-
- Types defined recursively are not supported by API Management.
145-
- For example, refer to an array of themselves.
146-
- **Multiple Namespaces**
147-
- While multiple namespaces can be used in a schema, only the target namespace can be used to define message parts.
148-
- Namespaces other than the target are not preserved.
149-
- These namespaces are used to define other input or output elements.
150-
- Although such a WSDL document can be imported, on export, all message parts will have the WSDL target namespace.
151-
- **Arrays**
152-
- SOAP-to-REST transformation supports only wrapped arrays shown in the example below:
186+
### SOAP bindings
187+
- Only SOAP bindings of "document" and “literal” encoding style are supported.
188+
- No support for “rpc” style or SOAP-Encoding.
189+
190+
### WSDL:Import
191+
Not supported. Instead, merge the imports into one document.
192+
193+
### Messages with multiple parts
194+
This message type is not supported.
195+
196+
### WCF wsHttpBinding
197+
- SOAP services created with Windows Communication Foundation should use `basicHttpBinding`.
198+
- `wsHttpBinding` isn't supported.
199+
200+
### MTOM
201+
- Services using `MTOM` *may* work.
202+
- Official support isn't offered at this time.
203+
204+
### Recursion
205+
- Types defined recursively are not supported by API Management.
206+
- For example, refer to an array of themselves.
207+
208+
### Multiple Namespaces
209+
While multiple namespaces can be used in a schema, only the target namespace can be used to define message parts. These namespaces are used to define other input or output elements.
210+
211+
Namespaces other than the target are not preserved on export. While you can import a WSDL document defining message parts with other namespaces, all message parts will have the WSDL target namespace on export.
212+
213+
### Arrays
214+
SOAP-to-REST transformation supports only wrapped arrays shown in the example below:
153215

154216
```xml
155217
<complexType name="arrayTypeName">

0 commit comments

Comments
 (0)