Skip to content

Commit

Permalink
pr comment fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
parthbond180 committed Jan 5, 2021
1 parent 886c50f commit 700edf6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class JavaInstantSerializer : CustomSerializer<Instant>,
}

/**
* Serializer for an [Duration] representing it as a JSON string value formatted as an ISO-8601 timestamp.
* Serializer for an [Duration] representing it as a JSON string value formatted as an ISO-8601 duration format.
*
* @see DateTimeFormatter.ISO_INSTANT
*/
Expand All @@ -224,7 +224,7 @@ class JavaDurationSerializer : CustomSerializer<Duration>,
override fun generateSchema(generator: JsonSchemaGenerator): JsonObject {
return mapOf(
"type" to "string",
"format" to "date-time"
"format" to "iso-8601-duration"
).asJsonObject()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ class CordaTypesTest : KoinTest {
fun `test java duration serialization`() {
val serializer = getKoin().getSerializer(Duration::class)

assertEquals("""{"type":"string","format":"date-time"}""".asJsonObject(),
assertEquals("""{"type":"string","format":"iso-8601-duration"}""".asJsonObject(),
serializer.generateRecursiveSchema(getKoin().get()))

// "PT4H" is string for duration of 4 hours
Expand Down

0 comments on commit 700edf6

Please sign in to comment.