use version from the pom
Some checks failed
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Failing after 1m6s

This commit is contained in:
Lee
2024-04-10 10:48:15 +01:00
parent cb7c2e162f
commit c0c4e32809
2 changed files with 31 additions and 3 deletions

View File

@ -5,6 +5,8 @@ import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import io.swagger.v3.oas.models.servers.Server;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.info.BuildProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -12,6 +14,16 @@ import java.util.List;
@Configuration
public class OpenAPIConfiguration {
/**
* The build properties of the
* app, null if the app is not built.
*/
private final BuildProperties buildProperties;
@Autowired
public OpenAPIConfiguration(BuildProperties buildProperties) {
this.buildProperties = buildProperties;
}
@Bean
public OpenAPI defineOpenAPI() {
@ -25,7 +37,7 @@ public class OpenAPIConfiguration {
Info info = new Info();
info.setTitle("Minecraft Utilities API");
info.setVersion("1.0");
info.setVersion(buildProperties == null ? "N/A" : buildProperties.getVersion());
info.setDescription("Wrapper for the Minecraft APIs to make them easier to use.");
info.setContact(contact);
info.setLicense(new License().name("MIT License").url("https://opensource.org/licenses/MIT"));