Azure / azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.
MIT License
2.69k stars 5.12k forks source link

API Management Api_CreateOrUpdate does not honor the `displayName` property #13445

Open springcomp opened 3 years ago

springcomp commented 3 years ago

Overview

The Api_CreateOrUpdate operation creates a new API in Azure API Management.

When importing an API definition from a publically accessible internet address, one has to specify the format and value properties as well as, at least, the path property from the ApiContractProperties definition.

This definition also has a displayName property which does not seem to be used. Instead, the resulting API display name is taken from the title property from the API definition referred to when creating the API.

Repro steps

  1. Use the following content JSON file:
{
    "properties": {
        "format": "openapi-link",
        "value": "https://masked.blob.core.windows.net/public/swagger.json",
        "path": "echo",
        "displayName": "Custom Echo API",
        "apiType": "http",
        "protocols": [ "https" ]
    }
}
  1. Run the following command in a cloud shell
az rest `
    --method PUT `
    --uri /subscription/<sub>/resourceGroups/<rg>/providers/Microsoft.ApiManagement/service/<service>/apis/echo-api?api-version=2019-12-01 `
    --body `@api_createorupdate.json
  1. Notice that the display name is not the one specified in the ARM template.

It would be expected that display name should be: Custom Echo API. Instead, it is Echo API as taken from the title property in the API definition swagger file.

image

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @miaojiang.

Issue Details
### Overview The `Api_CreateOrUpdate` operation creates a new API in Azure API Management. When importing an API definition from a publically accessible internet address, one has to specify the `format` and `value` properties as well as, at least, the `path` property from the `ApiContractProperties` definition. This definition also has a `displayName` property which does not seem to be used. Instead, the resulting API display name is taken from the `title` property from the API definition referred to when creating the API. ### Repro steps 1. Use the following content JSON file: ```JSON { "properties": { "format": "openapi-link", "value": "https://masked.blob.core.windows.net/public/swagger.json", "path": "echo", "displayName": "Custom Echo API", "apiType": "http", "protocols": [ "https" ] } } ``` 2. Run the following command in a cloud shell ``` az rest ` --method PUT ` --uri /subscription//resourceGroups//providers/Microsoft.ApiManagement/service//apis/echo-api?api-version=2019-12-01 ` --body `@api_createorupdate.json ``` 3. Notice that the display name is not the one specified in the ARM template. It would be expected that display name should be: `Custom Echo API`. Instead, it is `Echo API` as taken from the `title` property in the API definition swagger file. ![image](https://user-images.githubusercontent.com/8488398/111148481-fa3a3880-858b-11eb-8969-53cc04de968f.png)
Author: springcomp
Assignees: -
Labels: `API Management`, `Service Attention`, `needs-triage`, `question`
Milestone: -