diff --git a/README.md b/README.md index 045e9f6..1351543 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,10 @@ Hi there! Looking for usage? View the [Wiki](https://git.rainnny.club/Rainnny/RE --- -## Postman -View the [Postman Collection](https://documenter.getpostman.com/view/24401599/2sA35Mxdu3) for easy testing! +## Swagger API +View the [Swagger API Docs](https://mc.rainnny.club/swagger-ui.html) for easy testing! -![Postman Logo](https://avatars.githubusercontent.com/u/10251060?s=72) +![Swagger Logo](https://avatars.githubusercontent.com/u/7658037?s=74) ## YourKit YourKit supports open source projects with innovative and intelligent tools for monitoring and profiling Java and .NET applications. diff --git a/pom.xml b/pom.xml index 7d7db14..f1df3f4 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ me.braydon RESTfulMC - 1.0-dev + 1.0.0 @@ -110,6 +110,14 @@ compile + + + org.springdoc + springdoc-openapi-starter-webmvc-ui + 2.0.2 + compile + + org.springframework.boot diff --git a/postman_collection.json b/postman_collection.json deleted file mode 100644 index 0f72f7c..0000000 --- a/postman_collection.json +++ /dev/null @@ -1,268 +0,0 @@ -{ - "info": { - "_postman_id": "100e9c6f-d2ea-4b97-bcdd-489789e54ce8", - "name": "RESTfulMC v1", - "description": "StartFragmentA simple, yet useful RESTful API for Minecraft utilizing Springboot.", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", - "_exporter_id": "24401599" - }, - "item": [ - { - "name": "Player", - "item": [ - { - "name": "Query Player", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{endpoint}}/player/", - "host": [ - "{{endpoint}}" - ], - "path": [ - "player", - "" - ] - } - }, - "response": [ - { - "name": "Example", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{endpoint}}/player/Rainnny", - "host": [ - "{{endpoint}}" - ], - "path": [ - "player", - "Rainnny" - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/json;charset=UTF-8" - } - ], - "cookie": [], - "body": "{\n \"cached\": -1,\n \"uniqueId\": \"fc1d5fe7-f29b-430d-80bb-3b093a638b0f\",\n \"username\": \"Rainnny\",\n \"skin\": {\n \"url\": \"http://textures.minecraft.net/texture/ac8db1928dc94e332cca7be9567c7bbf4c56563000667d3a58ade257cde34f82\",\n \"model\": \"SLIM\",\n \"parts\": {\n \"HEAD\": \"https://mc.rainnny.club/player/head/fc1d5fe7f29b430d80bb3b093a638b0f.png\"\n }\n },\n \"cape\": {\n \"url\": \"http://textures.minecraft.net/texture/2340c0e03dd24a11b15a8b33c2a7e9e32abb2051b2481d0ba7defd635ca7a933\"\n }\n}" - } - ] - }, - { - "name": "Skin Part Texture", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{endpoint}}/player/head/Rainnny.png?size=256", - "host": [ - "{{endpoint}}" - ], - "path": [ - "player", - "head", - "Rainnny.png" - ], - "query": [ - { - "key": "size", - "value": "256" - } - ] - } - }, - "response": [] - } - ] - }, - { - "name": "Server", - "item": [ - { - "name": "Query Server", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{endpoint}}/server//", - "host": [ - "{{endpoint}}" - ], - "path": [ - "server", - "", - "" - ] - } - }, - "response": [ - { - "name": "Query Java Server Example", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{endpoint}}/server/java/hypixel.net", - "host": [ - "{{endpoint}}" - ], - "path": [ - "server", - "java", - "hypixel.net" - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/json;charset=UTF-8" - } - ], - "cookie": [], - "body": "{\n \"value\": {\n \"version\": {\n \"name\": \"Requires MC 1.8 / 1.20\",\n \"protocol\": 47,\n \"protocolName\": \"1.8\"\n },\n \"favicon\": {\n \"base64\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAttklEQVR42nV7B3hc5bXt2Oq9Te+9d400TV2yLFndkiXZlm1Z7pY7roCxKc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Pjw/ViwbCla+/ulJ7HFU9lbLt+AHVduxs6rtkixa/r4+f+L178c2/eK2ITtV2z8NLZdsQFbGZt2rcPkjklsuWILNl2+CfNXL8W85eNsxEOSIhWy/P8VCU6qEJWjOEo/d1+Mwf8V4vW24cVoHx3H3OVrMbx6PeatXIfalk7UNLXhyuuuwubdWy8k5/Qfl5kN/t/Vzur7sHfxBBrIgjrWhnicTETL0CiblIj5mRgcQcvAEJr65qKxdwANPf2o7+5FfVcv6uZ0o65TPI7ahVTHdMyew+hEqr0TSSk6kJjVgdrW2Yg0tTLaaEvbGbMQqm9FUMjptHgqvUl6qCkwzSrxtLl48twbr5OePvfV1v/vqPliBOKNUkhMTWXY6mUJikg0t18Ip5vfN5uCv/m/ezrDmHEPQgkAAAAASUVORK5CYII=\",\n \"url\": \"https://mc.rainnny.club/server/icon/java/mc.hypixel.net\"\n },\n \"enforcesSecureChat\": false,\n \"preventsChatReports\": false,\n \"mojangBanned\": false,\n \"hostname\": \"mc.hypixel.net\",\n \"ip\": \"209.222.115.87\",\n \"port\": 25565,\n \"players\": {\n \"online\": 23350,\n \"max\": 200000,\n \"sample\": []\n },\n \"motd\": {\n \"raw\": [\n \" §aHypixel Network §c[1.8-1.20]\",\n \" §3§lSB 0.19.12 §7| §6§lTNT UPDATE §7| §b§lEASTER EVENT\"\n ],\n \"clean\": [\n \" Hypixel Network [1.8-1.20]\",\n \" SB 0.19.12 | TNT UPDATE | EASTER EVENT\"\n ],\n \"html\": [\n \" Hypixel Network [1.8-1.20]\",\n \" SB 0.19.12 | TNT UPDATE | EASTER EVENT\"\n ]\n }\n },\n \"cached\": -1\n}" - }, - { - "name": "Query Bedrock Server Example", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{endpoint}}/server/bedrock/gateway.wildnetwork.net", - "host": [ - "{{endpoint}}" - ], - "path": [ - "server", - "bedrock", - "gateway.wildnetwork.net" - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/json;charset=UTF-8" - } - ], - "cookie": [], - "body": "{\n \"value\": {\n \"uniqueId\": \"7545692553236775078\",\n \"edition\": \"MCPE\",\n \"version\": {\n \"protocol\": 662,\n \"name\": \"1.20.70\"\n },\n \"gamemode\": {\n \"name\": \"Survival\",\n \"numericId\": 1\n },\n \"hostname\": \"gateway.wildnetwork.net\",\n \"ip\": \"198.244.215.7\",\n \"port\": 19132,\n \"players\": {\n \"online\": 6,\n \"max\": 1000\n },\n \"motd\": {\n \"raw\": [\n \"WildNetwork\",\n \"WildNetwork - Prison - SMP\"\n ],\n \"clean\": [\n \"WildNetwork\",\n \"WildNetwork - Prison - SMP\"\n ],\n \"html\": [\n \"WildNetwork\",\n \"WildNetwork - Prison - SMP\"\n ]\n }\n },\n \"cached\": 1712635659910\n}" - } - ] - }, - { - "name": "Mojang Blocked?", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{endpoint}}/server/blocked/", - "host": [ - "{{endpoint}}" - ], - "path": [ - "server", - "blocked", - "" - ] - } - }, - "response": [ - { - "name": "Example", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{endpoint}}/server/blocked/hypixel.net", - "host": [ - "{{endpoint}}" - ], - "path": [ - "server", - "blocked", - "hypixel.net" - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/json;charset=UTF-8" - } - ], - "cookie": [], - "body": "{\n \"blocked\": false\n}" - } - ] - }, - { - "name": "Server Favicon", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{endpoint}}/server/icon/", - "host": [ - "{{endpoint}}" - ], - "path": [ - "server", - "icon", - "" - ] - } - }, - "response": [] - } - ] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "packages": {}, - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "packages": {}, - "exec": [ - "" - ] - } - } - ], - "variable": [ - { - "key": "endpoint", - "value": "https://mc.rainnny.club", - "type": "string" - } - ] -} \ No newline at end of file diff --git a/src/main/java/me/braydon/mc/RESTfulMC.java b/src/main/java/me/braydon/mc/RESTfulMC.java index a19c785..26e1dd3 100644 --- a/src/main/java/me/braydon/mc/RESTfulMC.java +++ b/src/main/java/me/braydon/mc/RESTfulMC.java @@ -25,6 +25,10 @@ package me.braydon.mc; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Contact; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.info.License; import lombok.NonNull; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; @@ -42,6 +46,13 @@ import java.util.Objects; */ @SpringBootApplication(exclude = { JacksonAutoConfiguration.class }) @Slf4j(topic = "RESTfulMC") +@OpenAPIDefinition(info = @Info( + title = "RESTfulMC", + description = "A simple, yet useful RESTful API for Minecraft utilizing Springboot.", + version = "1.0.0", + contact = @Contact(name = "Braydon (Rainnny)", url = "https://rainnny.club", email = "braydonrainnny@gmail.com"), + license = @License(name = "MIT License", url = "https://opensource.org/license/MIT") +)) public class RESTfulMC { public static final Gson GSON = new GsonBuilder() .setDateFormat("MM-dd-yyyy HH:mm:ss") diff --git a/src/main/java/me/braydon/mc/common/web/JsonWebRequest.java b/src/main/java/me/braydon/mc/common/web/JsonWebRequest.java index 383087d..95a8469 100644 --- a/src/main/java/me/braydon/mc/common/web/JsonWebRequest.java +++ b/src/main/java/me/braydon/mc/common/web/JsonWebRequest.java @@ -29,6 +29,7 @@ import lombok.NonNull; import lombok.RequiredArgsConstructor; import me.braydon.mc.RESTfulMC; import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; import java.io.IOException; import java.net.URI; @@ -113,7 +114,7 @@ public final class JsonWebRequest { try { HttpResponse response = HTTP_CLIENT.send(request.build(), HttpResponse.BodyHandlers.ofString()); status = response.statusCode(); // Set the response status - if (status != 200) { // Status code is not OK, raise an exception + if (status != HttpStatus.OK.value()) { // Status code is not OK, raise an exception throw new IOException("Failed to make a %s request to %s: %s".formatted(method.name(), endpoint, status)); } // Return with the response as the type diff --git a/src/main/java/me/braydon/mc/controller/PlayerController.java b/src/main/java/me/braydon/mc/controller/PlayerController.java index 9f5a4ad..2400d35 100644 --- a/src/main/java/me/braydon/mc/controller/PlayerController.java +++ b/src/main/java/me/braydon/mc/controller/PlayerController.java @@ -23,6 +23,7 @@ */ package me.braydon.mc.controller; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.NonNull; import lombok.extern.log4j.Log4j2; import me.braydon.mc.exception.impl.BadRequestException; @@ -45,6 +46,7 @@ import org.springframework.web.bind.annotation.*; @RestController @RequestMapping(value = "/player", produces = MediaType.APPLICATION_JSON_VALUE) @Log4j2(topic = "Player Controller") +@Tag(name = "Player Controller", description = "The controller for handling player related requests.") public final class PlayerController { /** * The Mojang service to use for player information. diff --git a/src/main/java/me/braydon/mc/controller/ServerController.java b/src/main/java/me/braydon/mc/controller/ServerController.java index 3444a33..7760719 100644 --- a/src/main/java/me/braydon/mc/controller/ServerController.java +++ b/src/main/java/me/braydon/mc/controller/ServerController.java @@ -23,6 +23,7 @@ */ package me.braydon.mc.controller; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.NonNull; import lombok.extern.log4j.Log4j2; import me.braydon.mc.exception.impl.BadRequestException; @@ -47,6 +48,7 @@ import java.util.Map; @RestController @RequestMapping(value = "/server", produces = MediaType.APPLICATION_JSON_VALUE) @Log4j2(topic = "Server Controller") +@Tag(name = "Server Controller", description = "The controller for handling server related requests.") public final class ServerController { /** * The Mojang service to use for server information. diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 94e7fb5..6c89f48 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -3,6 +3,8 @@ server: address: 0.0.0.0 port: 7500 publicUrl: "http://localhost:7500" # The publicly accessible URL for this app + servlet: + context-path: / # Log Configuration logging: