From 780f5fcb9cbc8db811eef63578f14d01d4ec1611 Mon Sep 17 00:00:00 2001 From: John Lambert Date: Mon, 22 Jan 2024 17:04:44 -0500 Subject: [PATCH] Update endpoint --- .../Controllers/TranslationEngineTypesController.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Serval.Translation/Controllers/TranslationEngineTypesController.cs b/src/Serval.Translation/Controllers/TranslationEngineTypesController.cs index f79829cf..a340a845 100644 --- a/src/Serval.Translation/Controllers/TranslationEngineTypesController.cs +++ b/src/Serval.Translation/Controllers/TranslationEngineTypesController.cs @@ -47,28 +47,32 @@ CancellationToken cancellationToken /// Will say if the language is supported by the NLLB model natively and the resolved NLLB language code. /// /// A valid engine type: SmtTransfer, Nmt, or Echo - /// A language code to be mapped + /// A language code to be mapped /// /// Language information for the specified engine type /// The client is not authenticated /// The authenticated client cannot perform the operation /// A necessary service is currently unavailable. Check `/health` for more details. [Authorize(Scopes.ReadTranslationEngines)] - [HttpGet("{engineType}/language-info/{language}")] + [HttpGet("{engineType}/languages/{languageCode}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)] [ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)] [ProducesResponseType(typeof(void), StatusCodes.Status503ServiceUnavailable)] public async Task> GetLanguageInfoAsync( [NotNull] string engineType, - [NotNull] string language, + [NotNull] string languageCode, CancellationToken cancellationToken ) { try { return Map( - await _engineService.GetLanguageInfoAsync(engineType, language, cancellationToken: cancellationToken) + await _engineService.GetLanguageInfoAsync( + engineType: engineType, + language: languageCode, + cancellationToken: cancellationToken + ) ); } catch (InvalidOperationException ioe)