Skip to content

Commit

Permalink
GH-231 Support fallback to 'default' version when .index file is miss…
Browse files Browse the repository at this point in the history
…ing (Resolve #231)
  • Loading branch information
dzikoysk committed Sep 25, 2024
1 parent 19c1762 commit cff4deb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,9 @@ enum class HttpMethod {
class OpenApiLoader {

fun loadOpenApiSchemes(): Map<String, String> =
loadVersions().associateWith { loadVersion(it) ?: "{}" }
loadVersions()
.ifEmpty { setOf("default") }
.associateWith { loadVersion(it) ?: "{}" }

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

0 comments on commit cff4deb

Please sign in to comment.