Merge pull request #1026 from tgstation/1023-FixAPI

Change API recursive points
This commit is contained in:
Jordan Brown
2020-05-25 21:37:35 -04:00
committed by GitHub
5 changed files with 14 additions and 6 deletions
+2 -2
View File
@@ -3,8 +3,8 @@
<!-- This is the authorative version list -->
<!-- Integration tests will ensure they match across the board -->
<TgsCoreVersion>4.3.0</TgsCoreVersion>
<TgsApiVersion>6.4.1</TgsApiVersion>
<TgsClientVersion>7.0.2</TgsClientVersion>
<TgsApiVersion>6.5.0</TgsApiVersion>
<TgsClientVersion>7.1.0</TgsClientVersion>
<TgsDmapiVersion>5.2.1</TgsDmapiVersion>
<TgsControlPanelVersion>0.4.0</TgsControlPanelVersion>
<TgsHostWatchdogVersion>1.1.0</TgsHostWatchdogVersion>
@@ -18,6 +18,6 @@ namespace Tgstation.Server.Api.Models
/// <summary>
/// The <see cref="CompileJob"/>s made from the <see cref="RevisionInformation"/>
/// </summary>
public ICollection<CompileJob>? CompileJobs { get; set; }
public ICollection<EntityId>? CompileJobs { get; set; }
}
}
+1 -1
View File
@@ -16,6 +16,6 @@
/// <summary>
/// The <see cref="User"/> who created this <see cref="User"/>
/// </summary>
public User? CreatedBy { get; set; }
public Internal.User? CreatedBy { get; set; }
}
}
@@ -133,6 +133,14 @@ namespace Tgstation.Server.Host.Core
swaggerGenOptions.DocumentFilter<SwaggerConfiguration>();
swaggerGenOptions.SchemaFilter<SwaggerConfiguration>();
swaggerGenOptions.CustomSchemaIds(type =>
{
if (type == typeof(Api.Models.Internal.User))
return "ShallowUser";
return type.Name;
});
swaggerGenOptions.AddSecurityDefinition(PasswordSecuritySchemeId, new OpenApiSecurityScheme
{
In = ParameterLocation.Header,
@@ -48,9 +48,9 @@ namespace Tgstation.Server.Host.Models
OriginCommitSha = OriginCommitSha,
PrimaryTestMerge = PrimaryTestMerge?.ToApi(),
ActiveTestMerges = ActiveTestMerges.Select(x => x.TestMerge.ToApi()).ToList(),
CompileJobs = CompileJobs.Select(x => new Api.Models.CompileJob
CompileJobs = CompileJobs.Select(x => new Api.Models.EntityId
{
Id = x.Id // anti recursion measure
Id = x.Id
}).ToList()
};
}