Skip to content

Commit 026afd9

Browse files
committed
fix: return types for 400/404 for player/user/guild variables
1 parent 0b56f6f commit 026afd9

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ public object Transfer(Guid guildId, LookupKey lookupKey)
269269
}
270270

271271
[HttpGet("{guildId:guid}/bank")]
272-
[ProducesResponseType(typeof(NotFoundObjectResult), (int)HttpStatusCode.NotFound, "application/json")]
272+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.NotFound, "application/json")]
273273
[ProducesResponseType(typeof(IEnumerable<GuildBankSlot>), (int)HttpStatusCode.OK, "application/json")]
274274
public IActionResult ItemsListBank(Guid guildId)
275275
{
@@ -283,7 +283,7 @@ public IActionResult ItemsListBank(Guid guildId)
283283
}
284284

285285
[HttpGet("{guildId:guid}/variables")]
286-
[ProducesResponseType(typeof(NotFoundObjectResult), (int)HttpStatusCode.NotFound, "application/json")]
286+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.NotFound, "application/json")]
287287
[ProducesResponseType(typeof(IEnumerable<GuildVariable>), (int)HttpStatusCode.OK, "application/json")]
288288
public IActionResult GuildVariablesList(Guid guildId)
289289
{
@@ -296,8 +296,8 @@ public IActionResult GuildVariablesList(Guid guildId)
296296
}
297297

298298
[HttpGet("{guildId:guid}/variables/{variableId:guid}")]
299-
[ProducesResponseType(typeof(BadRequestObjectResult), (int)HttpStatusCode.BadRequest, "application/json")]
300-
[ProducesResponseType(typeof(NotFoundObjectResult), (int)HttpStatusCode.NotFound, "application/json")]
299+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.BadRequest, "application/json")]
300+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.NotFound, "application/json")]
301301
[ProducesResponseType(typeof(GuildVariable), (int)HttpStatusCode.OK, "application/json")]
302302
public IActionResult GuildVariableGet(Guid guildId, Guid variableId)
303303
{
@@ -321,8 +321,8 @@ public IActionResult GuildVariableGet(Guid guildId, Guid variableId)
321321
}
322322

323323
[HttpGet("{guildId:guid}/variables/{variableId:guid}/value")]
324-
[ProducesResponseType(typeof(BadRequestObjectResult), (int)HttpStatusCode.BadRequest, "application/json")]
325-
[ProducesResponseType(typeof(NotFoundObjectResult), (int)HttpStatusCode.NotFound, "application/json")]
324+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.BadRequest, "application/json")]
325+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.NotFound, "application/json")]
326326
[ProducesResponseType(typeof(VariableValueBody), (int)HttpStatusCode.OK, "application/json")]
327327
public IActionResult GuildVariableGetValue(Guid guildId, Guid variableId)
328328
{
@@ -349,8 +349,8 @@ public IActionResult GuildVariableGetValue(Guid guildId, Guid variableId)
349349
}
350350

351351
[HttpPost("{guildId:guid}/variables/{variableId:guid}")]
352-
[ProducesResponseType(typeof(BadRequestObjectResult), (int)HttpStatusCode.BadRequest, "application/json")]
353-
[ProducesResponseType(typeof(NotFoundObjectResult), (int)HttpStatusCode.NotFound, "application/json")]
352+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.BadRequest, "application/json")]
353+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.NotFound, "application/json")]
354354
[ProducesResponseType(typeof(GuildVariable), (int)HttpStatusCode.OK, "application/json")]
355355
public IActionResult GuildVariableSet(Guid guildId, Guid variableId, [FromBody] VariableValueBody valueBody)
356356
{

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ public object ChangeName(LookupKey lookupKey, [FromBody] NameChange change)
298298
}
299299

300300
[HttpGet("{lookupKey:LookupKey}/variables")]
301-
[ProducesResponseType(typeof(BadRequestObjectResult), (int)HttpStatusCode.BadRequest, "application/json")]
302-
[ProducesResponseType(typeof(NotFoundObjectResult), (int)HttpStatusCode.NotFound, "application/json")]
301+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.BadRequest, "application/json")]
302+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.NotFound, "application/json")]
303303
[ProducesResponseType(typeof(IEnumerable<PlayerVariable>), (int)HttpStatusCode.OK, "application/json")]
304304
public IActionResult PlayerVariablesList(LookupKey lookupKey)
305305
{
@@ -323,8 +323,8 @@ public IActionResult PlayerVariablesList(LookupKey lookupKey)
323323
}
324324

325325
[HttpGet("{lookupKey:LookupKey}/variables/{variableId:guid}")]
326-
[ProducesResponseType(typeof(BadRequestObjectResult), (int)HttpStatusCode.BadRequest, "application/json")]
327-
[ProducesResponseType(typeof(NotFoundObjectResult), (int)HttpStatusCode.NotFound, "application/json")]
326+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.BadRequest, "application/json")]
327+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.NotFound, "application/json")]
328328
[ProducesResponseType(typeof(PlayerVariable), (int)HttpStatusCode.OK, "application/json")]
329329
public IActionResult PlayerVariableGet(LookupKey lookupKey, Guid variableId)
330330
{
@@ -354,8 +354,8 @@ public IActionResult PlayerVariableGet(LookupKey lookupKey, Guid variableId)
354354
}
355355

356356
[HttpGet("{lookupKey:LookupKey}/variables/{variableId:guid}/value")]
357-
[ProducesResponseType(typeof(BadRequestObjectResult), (int)HttpStatusCode.BadRequest, "application/json")]
358-
[ProducesResponseType(typeof(NotFoundObjectResult), (int)HttpStatusCode.NotFound, "application/json")]
357+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.BadRequest, "application/json")]
358+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.NotFound, "application/json")]
359359
[ProducesResponseType(typeof(VariableValueBody), (int)HttpStatusCode.OK, "application/json")]
360360
public IActionResult PlayerVariableValueGet(LookupKey lookupKey, Guid variableId)
361361
{
@@ -388,8 +388,8 @@ public IActionResult PlayerVariableValueGet(LookupKey lookupKey, Guid variableId
388388
}
389389

390390
[HttpPost("{lookupKey:LookupKey}/variables/{variableId:guid}")]
391-
[ProducesResponseType(typeof(BadRequestObjectResult), (int)HttpStatusCode.BadRequest, "application/json")]
392-
[ProducesResponseType(typeof(NotFoundObjectResult), (int)HttpStatusCode.NotFound, "application/json")]
391+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.BadRequest, "application/json")]
392+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.NotFound, "application/json")]
393393
[ProducesResponseType(typeof(PlayerVariable), (int)HttpStatusCode.OK, "application/json")]
394394
public IActionResult PlayerVariableSet(LookupKey lookupKey, Guid variableId, [FromBody] VariableValueBody valueBody)
395395
{

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -868,8 +868,8 @@ public object UserSendPasswordResetEmailById(Guid userId)
868868
#region Variables
869869

870870
[HttpGet("{lookupKey:LookupKey}/variables")]
871-
[ProducesResponseType(typeof(BadRequestObjectResult), (int)HttpStatusCode.BadRequest, "application/json")]
872-
[ProducesResponseType(typeof(NotFoundObjectResult), (int)HttpStatusCode.NotFound, "application/json")]
871+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.BadRequest, "application/json")]
872+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.NotFound, "application/json")]
873873
[ProducesResponseType(typeof(IEnumerable<UserVariable>), (int)HttpStatusCode.OK, "application/json")]
874874
public IActionResult UserVariablesList(LookupKey lookupKey)
875875
{
@@ -887,8 +887,8 @@ public IActionResult UserVariablesList(LookupKey lookupKey)
887887
}
888888

889889
[HttpGet("{lookupKey:LookupKey}/variables/{variableId:guid}")]
890-
[ProducesResponseType(typeof(BadRequestObjectResult), (int)HttpStatusCode.BadRequest, "application/json")]
891-
[ProducesResponseType(typeof(NotFoundObjectResult), (int)HttpStatusCode.NotFound, "application/json")]
890+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.BadRequest, "application/json")]
891+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.NotFound, "application/json")]
892892
[ProducesResponseType(typeof(UserVariable), (int)HttpStatusCode.OK, "application/json")]
893893
public IActionResult UserVariableGet(LookupKey lookupKey, Guid variableId)
894894
{
@@ -917,8 +917,8 @@ public IActionResult UserVariableGet(LookupKey lookupKey, Guid variableId)
917917
}
918918

919919
[HttpGet("{lookupKey:LookupKey}/variables/{variableId:guid}/value")]
920-
[ProducesResponseType(typeof(BadRequestObjectResult), (int)HttpStatusCode.BadRequest, "application/json")]
921-
[ProducesResponseType(typeof(NotFoundObjectResult), (int)HttpStatusCode.NotFound, "application/json")]
920+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.BadRequest, "application/json")]
921+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.NotFound, "application/json")]
922922
[ProducesResponseType(typeof(VariableValueBody), (int)HttpStatusCode.OK, "application/json")]
923923
public IActionResult UserVariableValueGet(LookupKey lookupKey, Guid variableId)
924924
{
@@ -950,8 +950,8 @@ public IActionResult UserVariableValueGet(LookupKey lookupKey, Guid variableId)
950950
}
951951

952952
[HttpPost("{lookupKey:LookupKey}/variables/{variableId:guid}")]
953-
[ProducesResponseType(typeof(BadRequestObjectResult), (int)HttpStatusCode.BadRequest, "application/json")]
954-
[ProducesResponseType(typeof(NotFoundObjectResult), (int)HttpStatusCode.NotFound, "application/json")]
953+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.BadRequest, "application/json")]
954+
[ProducesResponseType(typeof(string), (int)HttpStatusCode.NotFound, "application/json")]
955955
[ProducesResponseType(typeof(UserVariable), (int)HttpStatusCode.OK, "application/json")]
956956
public IActionResult UserVariableSet(LookupKey lookupKey, Guid variableId, [FromBody] VariableValueBody valueBody)
957957
{

0 commit comments

Comments
 (0)