mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-29 08:00:19 +01:00
Correct version specification in Swagger spec [APIDeploy]
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
||||
<!-- This is the authorative version list -->
|
||||
<!-- Integration tests will ensure they match across the board -->
|
||||
<TgsCoreVersion>4.1.0</TgsCoreVersion>
|
||||
<TgsApiVersion>5.0.0</TgsApiVersion>
|
||||
<TgsApiVersion>5.0.1</TgsApiVersion>
|
||||
<TgsClientVersion>5.0.0</TgsClientVersion>
|
||||
<TgsDmapiVersion>5.0.0</TgsDmapiVersion>
|
||||
<TgsControlPanelVersion>0.1.6</TgsControlPanelVersion>
|
||||
|
||||
@@ -11,6 +11,7 @@ using Tgstation.Server.Api;
|
||||
using Tgstation.Server.Api.Models;
|
||||
using Tgstation.Server.Api.Rights;
|
||||
using Tgstation.Server.Host.Controllers;
|
||||
using Tgstation.Server.Host.Extensions;
|
||||
|
||||
namespace Tgstation.Server.Host.Core
|
||||
{
|
||||
@@ -121,7 +122,7 @@ namespace Tgstation.Server.Host.Core
|
||||
new OpenApiInfo
|
||||
{
|
||||
Title = "TGS API",
|
||||
Version = "v4"
|
||||
Version = ApiHeaders.Version.Semver()
|
||||
});
|
||||
|
||||
// Important to do this before applying our own filters
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
|
||||
namespace Tgstation.Server.Host.Extensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Extensions for the <see cref="Version"/> <see langword="class"/>.
|
||||
/// </summary>
|
||||
static class VersionExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts a given <paramref name="version"/> into a semver <see cref="string"/>.
|
||||
/// </summary>
|
||||
/// <param name="version">The <see cref="Version"/> to convert.</param>
|
||||
/// <returns>A semver <see cref="string"/> base on <paramref name="version"/>.</returns>
|
||||
public static string Semver(this Version version)
|
||||
{
|
||||
if (version == null)
|
||||
throw new ArgumentNullException(nameof(version));
|
||||
|
||||
return $"{version.Major}.{version.Minor}.{version.Build}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user