From cdb9fa05880f08aeaee37ea36c9dec87cc4a7289 Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Tue, 26 Sep 2023 19:58:26 +0200 Subject: [PATCH] docs(dynamite_runtime): document content string Signed-off-by: Nikolas Rimikis --- .../dynamite_runtime/lib/src/content_string.dart | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/dynamite/dynamite_runtime/lib/src/content_string.dart b/packages/dynamite/dynamite_runtime/lib/src/content_string.dart index af7118b1..9f75d638 100644 --- a/packages/dynamite/dynamite_runtime/lib/src/content_string.dart +++ b/packages/dynamite/dynamite_runtime/lib/src/content_string.dart @@ -5,17 +5,26 @@ import 'package:built_value/serializer.dart'; part 'content_string.g.dart'; +/// Json data encoded in a `String` as defined by [json-schema](https://json-schema.org/understanding-json-schema/reference/non_json_data.html#contentschema). abstract class ContentString implements Built, ContentStringBuilder> { + /// Creates a new content `String`. factory ContentString([final void Function(ContentStringBuilder)? b]) = _$ContentString; const ContentString._(); - /// decoded contentString + /// The decoded value of the content `String`. T get content; + /// The serializer for a content `String`. static Serializer> get serializer => _$contentStringSerializer; } +/// Serialization plugin for decoding [ContentString]s. +/// +/// This plugin must be after the `StandardJsonPlugin`. class ContentStringPlugin implements SerializerPlugin { + /// Creates a new serialization plugin for decoding [ContentString]s. + /// + /// This plugin must be after the `StandardJsonPlugin`. const ContentStringPlugin(); @override