Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>org.pkwmtt</groupId>
<artifactId>PKWMTT-backend</artifactId>
<version>0.1.0-ALPHA</version>
<version>1.0.0</version>
<name>PKWMTT-backend</name>
<description>PKWM App (Server) – timetable, exam calendar and ECTS calculator for students of Mechanical Engineering
@ Cracow University of Technology
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
package org.pkwmtt.global.config;


import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.Paths;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.parameters.Parameter;
import io.swagger.v3.oas.models.servers.Server;
import lombok.RequiredArgsConstructor;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

import java.util.List;

@Configuration
@RequiredArgsConstructor
public class SwaggerEndpointConfiguration {

private final Environment environment;

@Value("${swagger.url:http://localhost:8080}")
String url;

@Bean
public OpenAPI setOpenApiProtocol () {
return new OpenAPI().servers(List.of(new Server().url(url)));
}


//Add text field for api key to every request that need authentication with it
@Bean
public GroupedOpenApi publicEndpointCustomizer () {
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/application-prod.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ spring.mail.password=${EMAIL_PASSWORD:}
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
#Path
apiPrefix=/pkwmtt/api/v1
apiPrefix=/pkwmtt/api/v1
#Swagger https protocol
swagger.url=https://backend.pkwmapp.pl
Loading