Skip to content

Commit 808e3d8

Browse files
committed
adding kotlinLogging to openapi branch so the silent throwable is now logged
1 parent e8512de commit 808e3d8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

dataframe-openapi/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ repositories {
2020
dependencies {
2121
api(project(":core"))
2222

23+
implementation(libs.kotlinLogging)
2324
implementation(libs.kotlin.reflect)
2425
implementation(libs.kotlinpoet)
2526
api(libs.swagger) {

dataframe-openapi/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/isOpenApi.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
package org.jetbrains.kotlinx.dataframe.io
22

3+
import io.github.oshai.kotlinlogging.KotlinLogging
34
import io.swagger.parser.OpenAPIParser
45
import java.io.File
56
import java.net.URL
67

8+
private val logger = KotlinLogging.logger {}
9+
710
/** Needs to have any type schemas to convert. */
811
public fun isOpenApiStr(text: String): Boolean = try {
912
val parsed = OpenAPIParser().readContents(text, null, null)
1013
parsed.openAPI?.components?.schemas != null
11-
} catch (_: Throwable) {
14+
} catch (e: Throwable) {
15+
logger.debug(e) { "Attempt to read input as YAML/JSON OpenAPI specification failed." }
1216
false
1317
}
1418

0 commit comments

Comments
 (0)