Skip to content

Commit c5ddf68

Browse files
sunilmogadatipivovarit
authored andcommitted
BAEL-245: Issue 1753. Fix the typo - change from writeNumber() to writeString() (eugenp#1763)
* Add NDC and JBoss Logging to the demo application * NDC for Log4j, Log4j2 and JBoss Logging * Simplify NDC example by making it a single operation instead of two * Make NDC example as RestController, Use JBoss Logging only as a logging bridge * Fix merge conflicts in pull request - log-mdc pom.xml updated * BAEL-445 Update to Spring security SpEL example * BAEL-445: Change tabs to spaces in the updated code * BAEL-245: Add Enum Serialization exmaple * BAEL-245: Remove the folder jackson/src/test/java/com/baeldung/jackson/dtos/withEnum as the example is not used anymore * Add more enum serialization examples to align with previous example and prevent build fail * BAEL-611: Minor formatting changes * BAEL-611: Update Test case method names * BAEL-611 Add JAX-WS client and JUnit Test * BAEL-245: Issue 1753. Fix the typo - change from writeNumber() to writeString()
1 parent 196b869 commit c5ddf68

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎jackson/src/main/java/com/baeldung/jackson/serialization/DistanceSerializer.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public DistanceSerializer(Class<Distance> t) {
2323
public void serialize(Distance distance, JsonGenerator generator, SerializerProvider provider) throws IOException, JsonProcessingException {
2424
generator.writeStartObject();
2525
generator.writeFieldName("name");
26-
generator.writeNumber(distance.name());
26+
generator.writeString(distance.name());
2727
generator.writeFieldName("unit");
2828
generator.writeString(distance.getUnit());
2929
generator.writeFieldName("meters");

0 commit comments

Comments
 (0)