File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
core/commonMain/src/kotlinx/serialization/builtins Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -247,15 +247,20 @@ public fun UShort.Companion.serializer(): KSerializer<UShort> = UShortSerializer
247247
248248/* *
249249 * Returns serializer for [Duration].
250- * It is serialized as a string that represents a duration in the ISO-8601-2 format.
250+ * It is serialized as a string that represents a duration in the format used by [Duration.toIsoString],
251+ * that is, the ISO-8601-2 format.
251252 *
252- * The result of serialization is similar to calling [Duration.toIsoString], for deserialization is [Duration.parseIsoString].
253+ * For deserialization, [Duration.parseIsoString] is used.
254+ *
255+ * @see Duration.toIsoString
256+ * @see Duration.parseIsoString
253257 */
254258public fun Duration.Companion.serializer (): KSerializer <Duration > = DurationSerializer
255259
256260/* *
257261 * Returns serializer for [Instant].
258- * It is serialized as a string that represents an instant in the format described in ISO-8601-1:2019, 5.4.2.1b).
262+ * It is serialized as a string that represents an instant in the format used by [Instant.toString]
263+ * and described in ISO-8601-1:2019, 5.4.2.1b).
259264 *
260265 * Deserialization is case-insensitive.
261266 * More details can be found in the documentation of [Instant.toString] and [Instant.parse] functions.
Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ import kotlinx.serialization.encoding.*
1010import kotlin.time.ExperimentalTime
1111import kotlin.time.Instant
1212
13+ /* *
14+ * Serializer that encodes and decodes [Instant] as its second and nanosecond components of the Unix time.
15+ *
16+ * JSON example: `{"epochSeconds":1607505416,"nanosecondsOfSecond":124000}`.
17+ */
1318@ExperimentalTime
1419public object InstantComponentSerializer : KSerializer<Instant> {
1520
You can’t perform that action at this time.
0 commit comments