Skip to content

Commit d854afe

Browse files
author
Mathias Düsterhöft
committed
Be more careful when defaulting spec version to project version
1 parent 3cc0e0b commit d854afe

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

restdocs-openapi-gradle-plugin/src/main/kotlin/com/epages/restdocs/openapi/gradle/RestdocsOpenApiPluginExtension.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ open class RestdocsOpenApiPluginExtension(val project: Project) {
1010
var schemes: Array<String> = arrayOf("http")
1111

1212
var title = "API documentation"
13-
var version = project.version as String
13+
var version = project.version as? String ?: "1.0.0"
1414

1515
var format = "json"
1616

samples/restdocs-openapi-sample/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ buildscript {
99
}
1010
dependencies {
1111
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
12-
classpath("com.github.epages-de.restdocs-openapi:restdocs-openapi-gradle-plugin:0.2.0")
12+
classpath("com.github.epages-de.restdocs-openapi:restdocs-openapi-gradle-plugin:0.2.2")
1313
}
1414
}
1515

@@ -42,7 +42,7 @@ dependencies {
4242
testCompile('org.springframework.boot:spring-boot-starter-test')
4343
testCompile('org.springframework.restdocs:spring-restdocs-mockmvc')
4444

45-
testCompile('com.github.epages-de.restdocs-openapi:restdocs-openapi:0.2.1')
45+
testCompile('com.github.epages-de.restdocs-openapi:restdocs-openapi:0.2.2')
4646
//testCompile project(':restdocs-openapi') //enable for depending on the submodule directly
4747
testCompile('com.google.guava:guava:23.0')
4848
}
@@ -55,6 +55,6 @@ openapi {
5555
host = 'localhost:8080'
5656
basePath = '/api'
5757
title = 'My API'
58-
version = '1.0.0'
58+
version = '0.1.0'
5959
format = 'json'
6060
}

0 commit comments

Comments
 (0)