to_json: Convert to JSON-serializable list

to_jsonR Documentation

Convert to JSON-serializable list

Description

Convert an rtemis S7 object to a named list suitable for jsonlite::toJSON(auto_unbox = TRUE). Used by the rtemislive backend to send structured results to the browser frontend without scraping R console output.

Usage

to_json(x, ...)

Arguments

x

rtemis S7 object.

...

Additional arguments passed to method.

Details

The output carries only what the object's schema declares. Every results schema is additionalProperties: false, so a key the schema does not name makes the document invalid against the contract it is published under.

The default method walks the class's published properties (see prop_published()), recursing into S7-typed properties and passing through primitive properties as-is. A computed view or an R-only value is omitted: the first is recoverable from what is published, and the second has no wire form at all, so emitting either would put a value on the wire that no schema declares. Per-class methods override where the default isn't appropriate (e.g. where some props should be excluded for size or relevance reasons).

Value

Named list. Pass through jsonlite::toJSON(auto_unbox = TRUE) for serialization.

Author(s)

EDG

Examples

to_json(check_data(iris))

rtemis documentation built on Oct. 20, 2026, 1:06 a.m.