From d8c7123fffd5e662222a1b2fcfaff62d4a65b97e Mon Sep 17 00:00:00 2001 From: domirusz24 Date: Wed, 19 Jul 2023 20:28:40 +0200 Subject: [PATCH] Added the required API version to the OpenAPI info configuration. (https://swagger.io/specification/v3/#info-object) --- .../bibliothek/configuration/AppConfiguration.java | 11 +++++++++++ .../configuration/OpenAPIConfiguration.java | 1 + 2 files changed, 12 insertions(+) diff --git a/src/main/java/io/papermc/bibliothek/configuration/AppConfiguration.java b/src/main/java/io/papermc/bibliothek/configuration/AppConfiguration.java index 1f1f5c1..075442a 100644 --- a/src/main/java/io/papermc/bibliothek/configuration/AppConfiguration.java +++ b/src/main/java/io/papermc/bibliothek/configuration/AppConfiguration.java @@ -34,6 +34,7 @@ public class AppConfiguration { private URL apiBaseUrl; private String apiTitle; + private String apiVersion; private @NotNull Path storagePath; @SuppressWarnings("checkstyle:MethodName") @@ -56,6 +57,16 @@ public void setApiTitle(final String apiTitle) { this.apiTitle = apiTitle; } + @SuppressWarnings("checkstyle:MethodName") + public String getApiVersion() { + return this.apiVersion; + } + + @SuppressWarnings("checkstyle:MethodName") + public void setApiVersion(final String apiVersion) { + this.apiVersion = apiVersion; + } + @SuppressWarnings("checkstyle:MethodName") public Path getStoragePath() { return this.storagePath; diff --git a/src/main/java/io/papermc/bibliothek/configuration/OpenAPIConfiguration.java b/src/main/java/io/papermc/bibliothek/configuration/OpenAPIConfiguration.java index b36301f..6152861 100644 --- a/src/main/java/io/papermc/bibliothek/configuration/OpenAPIConfiguration.java +++ b/src/main/java/io/papermc/bibliothek/configuration/OpenAPIConfiguration.java @@ -43,6 +43,7 @@ OpenAPI openAPI(final AppConfiguration configuration) { api.info( new Info() .title(configuration.getApiTitle()) + .version(configuration.getApiVersion()) ); final URL apiBaseUrl = configuration.getApiBaseUrl(); if (apiBaseUrl != null) {