writeRaw abstract method

void writeRaw(
  1. String json
)

Writes a raw JSON fragment directly to output.

This bypasses validation and escaping logic, allowing insertion of preformatted JSON content.

⚠️ Warning

Use cautiously — malformed JSON fragments will corrupt the output stream.

Example

generator.writeRaw('"custom": {"nested": true}');

Notes

  • Best used for embedding external JSON or advanced serializers

Implementation

void writeRaw(String json);