编辑 API

本教程中的步骤演示如何使用 API 管理来编辑 API。

  • 可以在 Azure 门户中添加、重命名或删除操作。
  • 可以编辑 API 的 swagger。

先决条件

转到你的 API 管理实例

  1. 在 Azure 门户中搜索并选择“API 管理服务” 。

    Select API Management services

  2. 在“API 管理”服务页上,选择你的 API 管理实例。

    Select your API Management instance

编辑操作

Screenshot that highlights the process for editing an API in API Management.

  1. 单击“API”选项卡。
  2. 选择以前导入的某个 API。
  3. 选择“设计”选项卡。
  4. 选择要编辑的操作。
  5. 若要重命名该操作,请在“前端”窗口中选择“铅笔”

更新 swagger

可以通过执行以下步骤来从 Azure 门户更新后端 API:

  1. 选择“所有操作”

  2. 单击“前端”窗口中的铅笔。

    Screenshot that highlights the pencil icon in the Frontend screen.

    将显示 API 的 swagger。

    Edit an api

  3. 更新 swagger。

  4. 按“保存”。

注意

如果正在编辑 API 的非当前修订版,则无法更改以下属性:

  • 名称
  • Type
  • 说明
  • 需要订阅
  • API 版本
  • API 版本说明
  • 路径
  • 协议

如果编辑更改了非当前修订版的上述任何属性,则将显示错误消息 Can't change property for non-current revision

后续步骤