Azure / Azure/azure-rest-api-specs

API Management Api_CreateOrUpdate does not honor the `displayName` property

Open
#13,445 1 comment 0 reactions 0 assignees View on GitHub
API Management question Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
3d 2h
Merged PRs (30d)
424

Description

### 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)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Api_CreateOrUpdate request from the issue with the shown ARM JSON and linked OpenAPI document. Inspect the Azure API Management specification entry for this operation and compare how displayName and the imported definition title are represented. Done means the request produces an API named "Custom Echo API" when displayName is supplied.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, openapi
Domain
api, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.