-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose Context.outputStream() such that outputStream can be used dire…
…ctly (#109) For example, with Jsonb we can obtain the specific type once and then write directly to the outputSteam like: ctx.status(200).contentType("application/json"); var result = HelloDto.rob(); jsonTypeHelloDto.toJson(result, ctx.outputStream()); ... where jsonTypeHelloDto is obtained like: static final Jsonb jsonb = Jsonb.builder().build(); static final JsonType<HelloDto> jsonTypeHelloDto = jsonb.type(HelloDto.class); With this approach, it effectively bypasses the underlying io.avaje.jex.spi.JsonService with the view that this can be more flexible and more efficient.
- Loading branch information
Showing
5 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
package io.avaje.jex.jdk; | ||
|
||
import io.avaje.jsonb.Json; | ||
|
||
@Json | ||
public class HelloDto { | ||
|
||
public long id; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters