Skip to content

Commit cff4deb

Browse files
committed
GH-231 Support fallback to 'default' version when .index file is missing (Resolve #231)
1 parent 19c1762 commit cff4deb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

openapi-specification/src/main/kotlin/io/javalin/openapi/OpenApiAnnotations.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,9 @@ enum class HttpMethod {
302302
class OpenApiLoader {
303303

304304
fun loadOpenApiSchemes(): Map<String, String> =
305-
loadVersions().associateWith { loadVersion(it) ?: "{}" }
305+
loadVersions()
306+
.ifEmpty { setOf("default") }
307+
.associateWith { loadVersion(it) ?: "{}" }
306308

307309
fun loadVersions(): Set<String> =
308310
OpenApiLoader::class.java.getResourceAsStream("/openapi-plugin/.index")

0 commit comments

Comments
 (0)