Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Bump com.diffplug.spotless from 6.25.0 to 7.0.0 #1144

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ org-testcontainers = "1.20.4"
owasp-dependencycheck = "11.1.1"
protobuf = "4.29.2"
protobuf-plugin = "0.9.4"
spotless = "6.25.0"
spotless = "7.0.0"
spring-boot-plugin = "3.4.1"
spring-cloud = "2024.0.0" # not managed by spring-boot-dependencies
spring-cloud-stream = "4.2.0" # not managed by spring-boot-dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ import kotlinx.serialization.encoding.Encoder
import java.time.LocalDate
import java.time.format.DateTimeFormatter

/**
* Kotlinx LocalDate Serializer from string to LocalDate from ISO format (`yyyy-MM-dd`).
*/
/** Kotlinx LocalDate Serializer from string to LocalDate from ISO format (`yyyy-MM-dd`). */
object LocalDateSerializer : KSerializer<LocalDate> {
private const val DATE_PATTERN: String = "yyyy-MM-dd"
private val dateTimeFormatter: DateTimeFormatter = DateTimeFormatter.ofPattern(DATE_PATTERN)

override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("LocalDate", PrimitiveKind.STRING)
override val descriptor: SerialDescriptor =
PrimitiveSerialDescriptor("LocalDate", PrimitiveKind.STRING)

override fun deserialize(decoder: Decoder): LocalDate {
return LocalDate.parse(decoder.decodeString(), dateTimeFormatter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,24 @@ import java.time.LocalDate

@Serializable
data class SampleEvent(
@SerialName("string_field")
val stringField: String,
@SerialName("optional_field")
val optionalField: String? = null,
@SerialName("boolean_field")
val booleanField: Boolean,
@SerialName("int_field")
val intField: Int,
@SerialName("long_field")
val longField: Long,
@SerialName("float_field")
val floatField: Float,
@SerialName("double_field")
val doubleField: Double,
@SerialName("short_field")
val shortField: Short,
@SerialName("byte_field")
val byteField: Byte,
@SerialName("list_field")
val listField: List<String>,
@SerialName("set_field")
val setField: Set<String>,
@SerialName("map_field")
val mapField: Map<Int, String>,
@SerialName("string_field") val stringField: String,
@SerialName("optional_field") val optionalField: String? = null,
@SerialName("boolean_field") val booleanField: Boolean,
@SerialName("int_field") val intField: Int,
@SerialName("long_field") val longField: Long,
@SerialName("float_field") val floatField: Float,
@SerialName("double_field") val doubleField: Double,
@SerialName("short_field") val shortField: Short,
@SerialName("byte_field") val byteField: Byte,
@SerialName("list_field") val listField: List<String>,
@SerialName("set_field") val setField: Set<String>,
@SerialName("map_field") val mapField: Map<Int, String>,
@SerialName("date_field")
@Serializable(with = LocalDateSerializer::class)
val dateField: LocalDate,
@SerialName("enum_field")
val enumField: Color,
@SerialName("nested_class")
val nestedClass: NestedClass?,
@SerialName("listed_references")
val listedReferences: List<NestedClass>,
@SerialName("enum_field") val enumField: Color,
@SerialName("nested_class") val nestedClass: NestedClass?,
@SerialName("listed_references") val listedReferences: List<NestedClass>,
) {
@Serializable
data class NestedClass(
Expand All @@ -57,32 +42,27 @@ enum class Color {

@Serializable
data class ClassWithListProperty(
@SerialName("list_field")
val listField: List<String>,
@SerialName("list_field") val listField: List<String>,
)

@Serializable
data class ClassWithSetProperty(
@SerialName("set_field")
val setField: Set<String>,
@SerialName("set_field") val setField: Set<String>,
)

@Serializable
data class ClassWithCollectionProperty(
@SerialName("collection_field")
val setField: Collection<String>,
@SerialName("collection_field") val setField: Collection<String>,
)

@Serializable
data class ClassWithEnumProperty(
@SerialName("enum_field")
val enumField: Color,
@SerialName("enum_field") val enumField: Color,
)

@Serializable
data class ClassWithNestedProperty(
@SerialName("nested_class")
val nestedClass: NestedClass,
@SerialName("nested_class") val nestedClass: NestedClass,
) {
@Serializable
data class NestedClass(
Expand All @@ -94,12 +74,10 @@ data class ClassWithNestedProperty(

@Serializable
data class ClassWithPolymorphism(
@SerialName("pet")
val pet: Pet,
@SerialName("pet") val pet: Pet,
)

@Serializable
sealed interface Pet
@Serializable sealed interface Pet

@Serializable
@SerialName("dog")
Expand Down
Loading