Skip to content

Commit 35cb74d

Browse files
committed
Exclude legacy endpoint from generated OpenAPI document
1 parent 56a876d commit 35cb74d

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

API/Controller/Device/Pair.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,13 @@ public async Task<IActionResult> Pair([FromRoute] string pairCode)
3232
}
3333

3434
/// <summary>
35-
/// Pair a device with a pair code.
35+
/// Pair a device with a pair code, legacy endpoint kept for backwards compatibility
3636
/// </summary>
37-
/// <param name="pairCode">The pair code to pair with.</param>
38-
/// <response code="200">Successfully assigned LCG node</response>
39-
/// <response code="404">No such pair code exists</response>
4037
[AllowAnonymous]
4138
[MapToApiVersion("1")]
42-
[HttpGet("~/{version:apiVersion}/pair/{pairCode}", Name = "PairDeviceByCode_DEPRECATED")] // Backwards compatibility
43-
[EndpointName("PairDeviceByCode_DEPRECATED")]
39+
[HttpGet("~/{version:apiVersion}/pair/{pairCode}")]
40+
[ExcludeFromDescription]
4441
[EnableRateLimiting("auth")]
45-
[ProducesResponseType<LegacyDataResponse<string>>(StatusCodes.Status200OK, MediaTypeNames.Application.Json)]
46-
[ProducesResponseType<OpenShockProblem>(StatusCodes.Status404NotFound, MediaTypeNames.Application.ProblemJson)] // PairCodeNotFound
4742
public async Task<IActionResult> PairDeprecated([FromRoute] string pairCode)
4843
{
4944
return await PairInternal(pairCode);

0 commit comments

Comments
 (0)