From 719b5dee0fdc361970b7288d799ded9aa1d3cef3 Mon Sep 17 00:00:00 2001 From: Kevin BEAUGRAND <9513635+kbeaugrand@users.noreply.github.com> Date: Mon, 14 Feb 2022 17:30:41 +0100 Subject: [PATCH] Change operation names in API documentation (#261) --- .../v1.0/DeviceModelCommandsController.cs | 4 ++-- .../Controllers/v1.0/DeviceModelsController.cs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/AzureIoTHub.Portal/Server/Controllers/v1.0/DeviceModelCommandsController.cs b/src/AzureIoTHub.Portal/Server/Controllers/v1.0/DeviceModelCommandsController.cs index c7c893928..8aacd5205 100644 --- a/src/AzureIoTHub.Portal/Server/Controllers/v1.0/DeviceModelCommandsController.cs +++ b/src/AzureIoTHub.Portal/Server/Controllers/v1.0/DeviceModelCommandsController.cs @@ -56,7 +56,7 @@ public DeviceModelCommandsController( /// The model identifier. /// The command. /// The action result. - [HttpPost] + [HttpPost(Name = "POST Device model command")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] public async Task Post(string id, DeviceModelCommand command) @@ -101,7 +101,7 @@ await this.tableClientFactory /// The command identifier. /// The action result. /// If the device model's command is deleted. - [HttpDelete("{commandId}")] + [HttpDelete("{commandId}", Name = "DELETE Device model command")] [ProducesResponseType(StatusCodes.Status204NoContent)] public async Task Delete(string modelId, string commandId) { diff --git a/src/AzureIoTHub.Portal/Server/Controllers/v1.0/DeviceModelsController.cs b/src/AzureIoTHub.Portal/Server/Controllers/v1.0/DeviceModelsController.cs index 8d7ef18c8..0fe4a1d63 100644 --- a/src/AzureIoTHub.Portal/Server/Controllers/v1.0/DeviceModelsController.cs +++ b/src/AzureIoTHub.Portal/Server/Controllers/v1.0/DeviceModelsController.cs @@ -89,7 +89,7 @@ public DeviceModelsController( /// Gets the device models. /// /// The list of device models. - [HttpGet] + [HttpGet(Name = "GET Device models")] [ProducesResponseType(StatusCodes.Status200OK)] public IEnumerable Get() { @@ -109,7 +109,7 @@ public IEnumerable Get() /// /// The model identifier. /// The corresponding model. - [HttpGet("{id}")] + [HttpGet("{id}", Name = "GET Device model")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] public IActionResult Get(string id) @@ -140,7 +140,7 @@ public IActionResult Get(string id) /// /// The model identifier. /// The avatar. - [HttpGet("{id}/avatar")] + [HttpGet("{id}/avatar", Name = "GET Device model avatar")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] public IActionResult GetAvatar(string id) @@ -172,7 +172,7 @@ public IActionResult GetAvatar(string id) /// The model identifier. /// The file. /// The avatar. - [HttpPost("{id}/avatar")] + [HttpPost("{id}/avatar", Name = "POST Device model avatar")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] public async Task ChangeAvatar(string id, IFormFile file) @@ -202,7 +202,7 @@ public async Task ChangeAvatar(string id, IFormFile file) /// Deletes the avatar. /// /// The model identifier. - [HttpDelete("{id}/avatar")] + [HttpDelete("{id}/avatar", Name = "DELETE Device model avatar")] [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status404NotFound)] public async Task DeleteAvatar(string id) @@ -235,7 +235,7 @@ public async Task DeleteAvatar(string id) /// /// The device model. /// The action result. - [HttpPost] + [HttpPost(Name = "POST Device model")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] public async Task Post(DeviceModel deviceModel) @@ -277,7 +277,7 @@ public async Task Post(DeviceModel deviceModel) /// /// The device model. /// The action result. - [HttpPut] + [HttpPut(Name = "PUT Device model")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(StatusCodes.Status404NotFound)] @@ -318,7 +318,7 @@ public async Task Put(DeviceModel deviceModel) /// /// The device model identifier. /// The action result. - [HttpDelete("{id}")] + [HttpDelete("{id}", Name = "DELETE Device model")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] [ProducesResponseType(StatusCodes.Status400BadRequest)]