Skip to content

Commit de4148a

Browse files
committed
Update CHANGELOG
1 parent a6b6f76 commit de4148a

3 files changed

Lines changed: 34 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
9+
### Fixed
10+
- Improved Javadoc
911

1012
## [0.2.0] - 2026-01-12
1113
### Added

java/src/main/java/io/cucumber/messages/ndjson/Deserializer.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,24 @@
77

88
import static java.util.Objects.requireNonNull;
99

10+
/**
11+
* Deserializes a JSON string to a message.
12+
*/
1013
public final class Deserializer implements NdjsonToMessageIterable.Deserializer {
1114

1215
/**
13-
* Reads the given {@code json} and converts it to a link {@link Envelope}
16+
* Deserialize a JSON string to message.
17+
*
18+
* <ul>
19+
* <li>Values must be included unless their value is {@code null}
20+
* or an "absent" reference values such as empty optionals.
21+
* <li>Enums must be read as strings.
22+
* <li>Unknown properties must be ignored.
23+
* </ul>
24+
*
25+
* @param json to deserialize
26+
* @return a deserialized {@link Envelope} or null
27+
* @throws IOException if anything goes wrong
1428
*/
1529
@Override
1630
public Envelope readValue(String json) throws IOException {

java/src/main/java/io/cucumber/messages/ndjson/Serializer.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,26 @@
66
import java.io.IOException;
77
import java.io.Writer;
88

9+
/**
10+
* Serializes a message to a single line of JSON.
11+
*/
912
public final class Serializer implements MessageToNdjsonWriter.Serializer {
1013

1114
/**
12-
* Converts a given {@link Envelope} to single line of JSON and writes it
13-
* to the given writer.
15+
* Serialize a message to single line of JSON and write it to the
16+
* given {@code writer}.
17+
*
18+
* <ul>
19+
* <li>Values must be included unless their value is {@code null}
20+
* or an "absent" reference values such as empty optionals.
21+
* <li>Enums must be written as strings.
22+
* <li>Implementations may not close the {@code writer} after
23+
* writing a {@code value}.
24+
* </ul>
25+
*
26+
* @param writer to write to
27+
* @param value to serialize
28+
* @throws IOException if anything goes wrong
1429
*/
1530
@Override
1631
public void writeValue(Writer writer, Envelope value) throws IOException {

0 commit comments

Comments
 (0)