Enable JSON output.
This commit is contained in:
parent
4140d3531a
commit
914030841f
2 changed files with 14 additions and 1 deletions
|
@ -2,6 +2,7 @@ package ch.fritteli.labyrinth.server;
|
|||
|
||||
import ch.fritteli.labyrinth.generator.model.Labyrinth;
|
||||
import ch.fritteli.labyrinth.generator.renderer.html.HTMLRenderer;
|
||||
import ch.fritteli.labyrinth.generator.renderer.json.JsonRenderer;
|
||||
import ch.fritteli.labyrinth.generator.renderer.pdf.PDFRenderer;
|
||||
import ch.fritteli.labyrinth.generator.renderer.text.TextRenderer;
|
||||
import ch.fritteli.labyrinth.generator.serialization.SerializerDeserializer;
|
||||
|
@ -28,6 +29,18 @@ public enum OutputType {
|
|||
false,
|
||||
"h",
|
||||
"html"),
|
||||
JSON("application/json",
|
||||
"json",
|
||||
labyrinth -> JsonRenderer.newInstance().render(labyrinth).getBytes(StandardCharsets.UTF_8),
|
||||
false,
|
||||
"j",
|
||||
"json"),
|
||||
JSONFILE("application/json",
|
||||
"json",
|
||||
labyrinth -> JsonRenderer.newInstance().render(labyrinth).getBytes(StandardCharsets.UTF_8),
|
||||
true,
|
||||
"s",
|
||||
"jsonfile"),
|
||||
PDF("application/pdf",
|
||||
"pdf",
|
||||
labyrinth -> PDFRenderer.newInstance().render(labyrinth).toByteArray(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue