Skip to content

Commit

Permalink
Fixing the updates of Swagger dependencies to version 3.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariana Azevedo committed Jul 30, 2020
1 parent fe32dfd commit 93991be
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: java -jar -Dspring.profiles.active=prod -Dserver.port=$PORT target/financial-java-api-3.0.2-SNAPSHOT.jar
web: java -jar -Dspring.profiles.active=prod -Dserver.port=$PORT target/financial-java-api-3.0.3-SNAPSHOT.jar
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,14 @@ All `BigDecimal` values always contain exactly two decimal places, eg: `15.385`
This project was developed with:

* **Java 11 (Java Development Kit - JDK: 11.0.7)**
* **Spring Boot 2.3.0**
* **Spring Boot 2.3.2**
* **Spring Admin Client 2.2.3**
* **Maven**
* **JUnit 5**
* **Surfire**
* **PostgreSQL 12**
* **Flyway 6.4.1**
* **Swagger 2.10.5**
* **Swagger 3.0.0**
* **Model Mapper 2.3.8**
* **Heroku**
* **EhCache**
Expand All @@ -179,7 +179,7 @@ The API also was developed to run with an `jar`. In order to generate this `jar`
mvn package
```

It will clean, compile and generate a `jar` at target directory, e.g. `financial-java-api-3.0.2-SNAPSHOT.jar`
It will clean, compile and generate a `jar` at target directory, e.g. `financial-java-api-3.0.3-SNAPSHOT.jar`

### Execution

Expand Down Expand Up @@ -217,7 +217,7 @@ mvn integration-test
In order to run the API, run the jar simply as following:

```bash
java -jar financial-java-api-3.0.2-SNAPSHOT.jar --spring.profiles.active=prod
java -jar financial-java-api-3.0.3-SNAPSHOT.jar --spring.profiles.active=prod
```

or
Expand All @@ -230,7 +230,7 @@ By default, the API will be available at [http://localhost:8080/financial/v1](ht

### Documentation

* Swagger (development environment): http://localhost:8080/swagger-ui.html
* Swagger (development environment): http://localhost:8080/swagger-ui/index.html

#### Medium Articles

Expand Down
29 changes: 12 additions & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>io.github.mariazevedo88</groupId>
<artifactId>financial-java-api</artifactId>
<version>3.0.2-SNAPSHOT</version>
<version>3.0.3-SNAPSHOT</version>
<packaging>jar</packaging>

<name>financial-java-api</name>
Expand All @@ -21,7 +21,7 @@

<properties>
<java.version>11</java.version>
<swagger.version>2.10.5</swagger.version>
<swagger.version>3.0.0</swagger.version>
<modelmapper.version>2.3.8</modelmapper.version>
<bucket4j.version>4.10.0</bucket4j.version>
<spring.admin.version>2.2.3</spring.admin.version>
Expand Down Expand Up @@ -68,6 +68,16 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>${spring.admin.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand All @@ -87,16 +97,6 @@
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>org.modelmapper</groupId>
<artifactId>modelmapper</artifactId>
Expand All @@ -115,11 +115,6 @@
<artifactId>bucket4j-core</artifactId>
<version>${bucket4j.version}</version>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>${spring.admin.version}</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.mariazevedo88.financialjavaapi.util.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
Expand All @@ -10,7 +11,7 @@
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
* Class that implements the necessary settings for using Swagger as an API documentation tool.
Expand All @@ -20,9 +21,15 @@
*/
@Configuration
@Profile({"dev"})
@EnableSwagger2WebMvc
@EnableSwagger2
public class SwaggerConfiguration {

@Value("${release.version}")
private String releaseVersion;

@Value("${api.version}")
private String apiVersion;

/**
* Method that configure all the endpoint's mapped in the documentation.
*
Expand All @@ -49,7 +56,7 @@ public Docket api() {
*/
private ApiInfo apiInfo() {
return new ApiInfoBuilder().title("Financial Java API")
.description("Financial Java API - Endpoint's documentation").version("1.0.0")
.description("Financial Java API - Endpoint's documentation").version(releaseVersion.concat("_").concat(apiVersion))
.build();
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-prod.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pagination.items_per_page=10
jwt.secret=oioqowepjsjdasd!$%mknfskdnf090192019
jwt.expiration=6000

api.version=2020-07-29
api.version=2020-07-30
api.key="FX001-FREE"

#Enable response compression
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spring.cache.jcache.config=classpath:cache/ehcache.xml
spring.mvc.throw-exception-if-no-handler-found=true
spring.mvc.resources.add-mappings=false

api.version=2020-07-29
api.version=2020-07-30
api.key="FX001-FREE"

#Enable response compression
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ pagination.items_per_page=10
jwt.secret=qweernadnamdn19820918209!#ajhad
jwt.expiration=3600

api.version=2020-07-29
release.version=3.0.3
api.version=2020-07-30
api.key="FX001-FREE"

#Enable response compression
Expand Down

0 comments on commit 93991be

Please sign in to comment.