mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge branch '2.7.x'
This commit is contained in:
commit
17b5611ace
@ -33,8 +33,10 @@ class MyJsonComponent {
|
|||||||
class Serializer : JsonSerializer<MyObject>() {
|
class Serializer : JsonSerializer<MyObject>() {
|
||||||
@Throws(IOException::class)
|
@Throws(IOException::class)
|
||||||
override fun serialize(value: MyObject, jgen: JsonGenerator, serializers: SerializerProvider) {
|
override fun serialize(value: MyObject, jgen: JsonGenerator, serializers: SerializerProvider) {
|
||||||
|
jgen.writeStartObject()
|
||||||
jgen.writeStringField("name", value.name)
|
jgen.writeStringField("name", value.name)
|
||||||
jgen.writeNumberField("age", value.age)
|
jgen.writeNumberField("age", value.age)
|
||||||
|
jgen.writeEndObject()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user