From 5e57ffbcf9ac3a346d4bf2b692248393215bad89 Mon Sep 17 00:00:00 2001 From: Qstick Date: Mon, 31 Oct 2022 19:37:05 -0500 Subject: [PATCH] New: Base API info endpoint --- src/Sonarr.Http/ApiInfoController.cs | 23 +++++++++++++++++++++++ src/Sonarr.Http/ApiInfoResource.cs | 14 ++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/Sonarr.Http/ApiInfoController.cs create mode 100644 src/Sonarr.Http/ApiInfoResource.cs diff --git a/src/Sonarr.Http/ApiInfoController.cs b/src/Sonarr.Http/ApiInfoController.cs new file mode 100644 index 000000000..8f4f9bbd4 --- /dev/null +++ b/src/Sonarr.Http/ApiInfoController.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; + +namespace NzbDrone.Http +{ + public class ApiInfoController : Controller + { + public ApiInfoController() + { + } + + [HttpGet("/api")] + [Produces("application/json")] + public object GetApiInfo() + { + return new ApiInfoResource + { + Current = "v3", + Deprecated = new List() + }; + } + } +} diff --git a/src/Sonarr.Http/ApiInfoResource.cs b/src/Sonarr.Http/ApiInfoResource.cs new file mode 100644 index 000000000..dbb7cf2f5 --- /dev/null +++ b/src/Sonarr.Http/ApiInfoResource.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NzbDrone.Http +{ + public class ApiInfoResource + { + public string Current { get; set; } + public List Deprecated { get; set; } + } +}