Skip to content

Commit 3e4dcc4

Browse files
authored
make toJsonStream a default method (#210)
How often do people really use json streaming? Is it even an http standard media type?
1 parent a8f741a commit 3e4dcc4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

avaje-jex/src/main/java/io/avaje/jex/spi/JsonService.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public non-sealed interface JsonService extends JexExtension {
2626
/**
2727
* **Writes a Java Object as a JSON string**
2828
*
29-
* <p>Serializes a Java object into JSON string format and writes the resulting JSON to the specified
30-
* output stream.
29+
* <p>Serializes a Java object into JSON string format and writes the resulting JSON to the
30+
* specified output stream.
3131
*
3232
* @param bean the Java object to be serialized
3333
* @return the serialized JSON string
@@ -66,5 +66,7 @@ public non-sealed interface JsonService extends JexExtension {
6666
* @param iterator the stream of objects to be serialized
6767
* @param os the output stream to write the JSON-Stream data to
6868
*/
69-
<E> void toJsonStream(Iterator<E> iterator, OutputStream os);
69+
default <E> void toJsonStream(Iterator<E> iterator, OutputStream os) {
70+
throw new UnsupportedOperationException("toJsonStream is unimplemented in this JsonService");
71+
}
7072
}

0 commit comments

Comments
 (0)