Skip to content

Commit

Permalink
Add back swagger summaries
Browse files Browse the repository at this point in the history
  • Loading branch information
Citrinate committed Jan 6, 2025
1 parent 2aa7d22 commit a756587
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions CS2Interface/IPC/Api/CS2InterfaceController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
// using System.ComponentModel;
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;
Expand All @@ -9,16 +8,15 @@
using ArchiSteamFarm.IPC.Controllers.Api;
using ArchiSteamFarm.IPC.Responses;
using ArchiSteamFarm.Steam;
// using Microsoft.AspNetCore.Http;
// EndpointSummary and Description lines commented out temporarily to allow plugin to work with generic/non-generic ASF V6.1.2.0 and V6.1.1.3
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SteamKit2.GC.CSGO.Internal;

namespace CS2Interface.IPC {
[Route("Api/CS2Interface")]
public sealed class CS2InterfaceController : ArchiController {
[HttpGet("{botNames:required}/Start")]
// [EndpointSummary("Starts the CS2 Interface")]
[EndpointSummary("Starts the CS2 Interface")]
[ProducesResponseType(typeof(GenericResponse<IReadOnlyDictionary<string, GenericResponse>>), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
public async Task<ActionResult<GenericResponse>> Start(string botNames) {
Expand All @@ -45,7 +43,7 @@ public async Task<ActionResult<GenericResponse>> Start(string botNames) {
}

[HttpGet("{botNames:required}/Stop")]
// [EndpointSummary("Stops the CS2 Interface")]
[EndpointSummary("Stops the CS2 Interface")]
[ProducesResponseType(typeof(GenericResponse<IReadOnlyDictionary<string, GenericResponse>>), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
public ActionResult<GenericResponse> Stop(string botNames) {
Expand All @@ -67,7 +65,7 @@ public ActionResult<GenericResponse> Stop(string botNames) {
}

[HttpGet("{botNames:required}/Status")]
[SwaggerOperation (Summary = "Get the status of the CS2 Interface")]
[EndpointSummary("Get the status of the CS2 Interface")]
[ProducesResponseType(typeof(GenericResponse<IReadOnlyDictionary<string, ClientStatus>>), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
public ActionResult<GenericResponse> Status(string botNames) {
Expand All @@ -89,7 +87,7 @@ public ActionResult<GenericResponse> Status(string botNames) {
}

[HttpGet("{botNames:required}/InspectItem")]
// [EndpointSummary("Inspect a CS2 Item")]
[EndpointSummary("Inspect a CS2 Item")]
[ProducesResponseType(typeof(GenericResponse<InspectItem>), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.GatewayTimeout)]
Expand Down Expand Up @@ -145,7 +143,7 @@ public async Task<ActionResult<GenericResponse>> InspectItem(string botNames, [F
}

[HttpGet("{botName:required}/PlayerProfile/{steamID?}")]
// [EndpointSummary("Get a friend's CS2 player profile")]
[EndpointSummary("Get a friend's CS2 player profile")]
[ProducesResponseType(typeof(GenericResponse<CMsgGCCStrike15_v2_PlayersProfile>), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.GatewayTimeout)]
Expand Down Expand Up @@ -175,7 +173,7 @@ public async Task<ActionResult<GenericResponse>> PlayerProfile(string botName, u
}

[HttpGet("{botName:required}/Inventory/")]
// [EndpointSummary("Get the given bot's CS2 inventory")]
[EndpointSummary("Get the given bot's CS2 inventory")]
[ProducesResponseType(typeof(GenericResponse<List<InventoryItem>>), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
public ActionResult<GenericResponse> Inventory(string botName, [FromQuery] bool minimal = false, [FromQuery] bool showDefs = false) {
Expand Down Expand Up @@ -204,7 +202,7 @@ public ActionResult<GenericResponse> Inventory(string botName, [FromQuery] bool
}

[HttpGet("{botName:required}/GetCrateContents/{crateID:required}")]
// [EndpointSummary("Get the contents of the given bot's crate")]
[EndpointSummary("Get the contents of the given bot's crate")]
[ProducesResponseType(typeof(GenericResponse<List<InventoryItem>>), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.GatewayTimeout)]
Expand Down Expand Up @@ -236,7 +234,7 @@ public async Task<ActionResult<GenericResponse>> GetCrateContents(string botName
}

[HttpGet("{botName:required}/StoreItem/{crateID:required}/{itemID:required}")]
// [EndpointSummary("Stores an item into the specified crate")]
[EndpointSummary("Stores an item into the specified crate")]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.GatewayTimeout)]
Expand Down Expand Up @@ -265,7 +263,7 @@ public async Task<ActionResult<GenericResponse>> StoreItem(string botName, ulong
}

[HttpGet("{botName:required}/RetrieveItem/{crateID:required}/{itemID:required}")]
// [EndpointSummary("Retrieves an item from the specified crate")]
[EndpointSummary("Retrieves an item from the specified crate")]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.GatewayTimeout)]
Expand Down Expand Up @@ -294,7 +292,7 @@ public async Task<ActionResult<GenericResponse>> RetrieveItem(string botName, ul
}

[HttpGet("{botName:required}/CraftItem/{recipeID:required}")]
[SwaggerOperation (Summary = "Crafts an item using the specified trade up recipe")]
[EndpointSummary("Crafts an item using the specified trade up recipe")]
[ProducesResponseType(typeof(GenericResponse<GCMsg.MsgCraftResponse>), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.GatewayTimeout)]
Expand Down Expand Up @@ -333,7 +331,7 @@ public async Task<ActionResult<GenericResponse>> CraftItem(string botName, ushor
}

[HttpGet("Recipes")]
[SwaggerOperation (Summary = "Get a list of crafting recipes")]
[EndpointSummary("Get a list of crafting recipes")]
[ProducesResponseType(typeof(GenericResponse<List<Recipe>>), (int) HttpStatusCode.OK)]
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
public async Task<ActionResult<GenericResponse>> Recipes([FromQuery] bool showDefs = false) {
Expand Down

0 comments on commit a756587

Please sign in to comment.