BAEL-245: Issue 1753. Fix the typo - change from writeNumber() to writeString() (#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()
This commit is contained in:
parent
196b869fff
commit
c5ddf680a7
|
@ -23,7 +23,7 @@ public class DistanceSerializer extends StdSerializer<Distance> {
|
||||||
public void serialize(Distance distance, JsonGenerator generator, SerializerProvider provider) throws IOException, JsonProcessingException {
|
public void serialize(Distance distance, JsonGenerator generator, SerializerProvider provider) throws IOException, JsonProcessingException {
|
||||||
generator.writeStartObject();
|
generator.writeStartObject();
|
||||||
generator.writeFieldName("name");
|
generator.writeFieldName("name");
|
||||||
generator.writeNumber(distance.name());
|
generator.writeString(distance.name());
|
||||||
generator.writeFieldName("unit");
|
generator.writeFieldName("unit");
|
||||||
generator.writeString(distance.getUnit());
|
generator.writeString(distance.getUnit());
|
||||||
generator.writeFieldName("meters");
|
generator.writeFieldName("meters");
|
||||||
|
|
Loading…
Reference in New Issue