Skip to content

Commit ce82de9

Browse files
authored
Merge pull request #7 from flock-community/fix-consistent-naming
fix: consistent naming
2 parents da7155e + 9f220dd commit ce82de9

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/commonMain/kotlin/community/flock/kotlinx/openapi/bindings/OpenAPIV2.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import kotlinx.serialization.json.encodeToJsonElement
1111
open class OpenAPIV2(
1212
val json: Json = Json { prettyPrint = true },
1313
) : OpenAPISpecification {
14+
1415
fun decodeFromString(string: String): OpenAPIV2Model = json
1516
.decodeFromString<JsonObject>(string)
1617
.decode(V2)

src/commonMain/kotlin/community/flock/kotlinx/openapi/bindings/OpenAPIV3.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ open class OpenAPIV3(
1212
val json: Json = Json { prettyPrint = true },
1313
) : OpenAPISpecification {
1414

15-
fun decodeFromJsonString(string: String): OpenAPIV3Model = json
15+
fun decodeFromString(string: String): OpenAPIV3Model = json
1616
.decodeFromString<JsonObject>(string)
1717
.decode(V3)
1818
.let(json::decodeFromJsonElement)

src/jvmTest/kotlin/community/flock/kotlinx/openapi/bindings/OpenAPIV3Tests.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ class OpenAPIV3Tests {
4747
fun `openapi v2 is not valid`() {
4848
val input = readFile("petstore.json", V2)
4949
shouldThrow<IllegalStateException> {
50-
OpenAPIV3.decodeFromJsonString(input)
50+
OpenAPIV3.decodeFromString(input)
5151
}.message shouldBe "No valid openapi v3 element 'openapi' is missing"
5252
}
5353

5454
private fun openAPIv3(fileName: String) {
5555
readFile(fileName, V3).let {
5656
it shouldEqualJson it
57-
.let(OpenAPIV3::decodeFromJsonString)
57+
.let(OpenAPIV3::decodeFromString)
5858
.let(OpenAPIV3::encodeToString)
5959
}
6060
}

0 commit comments

Comments
 (0)