Skip to content

Commit 6d9eb93

Browse files
committed
clean up
1 parent 717fa80 commit 6d9eb93

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/kotlin/io/openapiprocessor/intellij/TypeMappingSchemaProvider.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import java.net.HttpURLConnection
1414

1515
const val GITHUB_PREFIX = "raw.githubusercontent.com/openapi-processor/openapi-processor/master/"
1616

17+
@Suppress("UnstableApiUsage")
1718
class TypeMappingSchemaProvider: ContentAwareJsonSchemaFileProvider {
1819

1920
override fun getSchemaFile(file: PsiFile): VirtualFile? {
@@ -39,15 +40,15 @@ class TypeMappingSchemaProvider: ContentAwareJsonSchemaFileProvider {
3940
return HttpsFileSystem.getHttpsInstance().findFileByPath(mergedUrl)
4041
}
4142

42-
// if there is no merged version try the original json schema
43+
// if there is no merged version, try the original json schema
4344
return HttpsFileSystem.getHttpsInstance().findFileByPath(
4445
"${GITHUB_PREFIX}public/schemas/mapping/$type-$version.json")
4546
}
4647

4748
private fun exists(url: String): Boolean {
4849
try {
4950
val connection = HttpConnectionUtils.openHttpConnection("https://${url}")
50-
connection.setRequestMethod("HEAD")
51+
connection.requestMethod = "HEAD"
5152
return connection.responseCode == HttpURLConnection.HTTP_OK
5253
} catch (_: Exception) {
5354
return false

0 commit comments

Comments
 (0)