decode static method

AcpDecoded<TextContent> decode(
  1. Object? json
)

Decodes this model and reports recoverable issues.

Implementation

static AcpDecoded<TextContent> decode(Object? json) {
  final decoder = AcpResilientDecoder(decodeAcpObject(json));
  final value = TextContent(
    text: decoder.required('text', (value) => decodeAcpString(value)),
    annotations: decoder
        .optionalOnError(
          'annotations',
          (value) => annotationsCodec.decode(value),
        )
        .valueOrNull,
    meta: decoder.meta(),
  );
  return decoder.finish(value);
}