Test openapi schema response of FindArticles

This commit is contained in:
2021-03-08 23:13:48 +01:00
parent 97c1e47db2
commit 4762275b5b
5 changed files with 246 additions and 1 deletions

View File

@@ -1,7 +1,15 @@
package fr.dcproject.common.utils
import java.net.URL
fun String.readResource(callback: (String) -> Unit = {}): String {
val content = callback::class.java.getResource(this).readText()
val content = callback::class.java.getResource(this)?.readText() ?: error("File not found")
callback(content)
return content
}
fun String.getResource(callback: (URL) -> Unit = {}): URL {
val content = callback::class.java.getResource(this) ?: error("File not found")
callback(content)
return content
}