Skip to content

Commit 03e9e7d

Browse files
committed
fix: rename API-only VariableValue struct to not break Swagger
1 parent e3688ce commit 03e9e7d

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

Intersect.Server/Web/RestApi/Payloads/VariableValue.cs renamed to Intersect.Server/Web/RestApi/Payloads/VariableValueAPI.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
namespace Intersect.Server.Web.RestApi.Payloads
22
{
33

4-
public partial struct VariableValue
4+
public partial struct VariableValueAPI
55
{
66

77
public dynamic Value { get; set; }

Intersect.Server/Web/RestApi/Routes/V1/GuildController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ public object GuildVariableGetValue(Guid guildId, Guid variableId)
331331
}
332332

333333
[HttpPost("{guildId:guid}/variables/{variableId:guid}")]
334-
public object GuildVariableSet(Guid guildId, Guid variableId, [FromBody] VariableValue value)
334+
public object GuildVariableSet(Guid guildId, Guid variableId, [FromBody] VariableValueAPI valueApi)
335335
{
336336
var guild = Guild.LoadGuild(guildId);
337337

@@ -350,11 +350,11 @@ public object GuildVariableSet(Guid guildId, Guid variableId, [FromBody] Variabl
350350
var changed = true;
351351
if (variable?.Value != null)
352352
{
353-
if (variable?.Value?.Value != value.Value)
353+
if (variable?.Value?.Value != valueApi.Value)
354354
{
355355
changed = false;
356356
}
357-
variable.Value.Value = value.Value;
357+
variable.Value.Value = valueApi.Value;
358358
}
359359

360360
if (changed)

Intersect.Server/Web/RestApi/Routes/V1/PlayerController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ public object PlayerVariableGetValue(LookupKey lookupKey, Guid variableId)
373373
}
374374

375375
[HttpPost("{lookupKey:LookupKey}/variables/{variableId:guid}")]
376-
public object PlayerVariableSet(LookupKey lookupKey, Guid variableId, [FromBody] VariableValue value)
376+
public object PlayerVariableSet(LookupKey lookupKey, Guid variableId, [FromBody] VariableValueAPI valueApi)
377377
{
378378
if (lookupKey.IsInvalid)
379379
{
@@ -400,11 +400,11 @@ public object PlayerVariableSet(LookupKey lookupKey, Guid variableId, [FromBody]
400400
var changed = true;
401401
if (variable?.Value != null)
402402
{
403-
if (variable?.Value?.Value != value.Value)
403+
if (variable?.Value?.Value != valueApi.Value)
404404
{
405405
changed = false;
406406
}
407-
variable.Value.Value = value.Value;
407+
variable.Value.Value = valueApi.Value;
408408
}
409409

410410
if (changed)

Intersect.Server/Web/RestApi/Routes/V1/VariablesController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public object GlobalVariableGetValue(Guid guid)
6969
}
7070

7171
[HttpPost("global/{guid:guid}")]
72-
public object GlobalVariableSet(Guid guid, [FromBody] VariableValue value)
72+
public object GlobalVariableSet(Guid guid, [FromBody] VariableValueAPI valueApi)
7373
{
7474
if (Guid.Empty == guid)
7575
{
@@ -84,11 +84,11 @@ public object GlobalVariableSet(Guid guid, [FromBody] VariableValue value)
8484
}
8585

8686
var changed = true;
87-
if (variable.Value?.Value == value.Value)
87+
if (variable.Value?.Value == valueApi.Value)
8888
{
8989
changed = false;
9090
}
91-
variable.Value.Value = value.Value;
91+
variable.Value.Value = valueApi.Value;
9292

9393
if (changed)
9494
{

0 commit comments

Comments
 (0)