View source: R/schema_contract.R
| assert_description_language | R Documentation |
The two prose rules of the input-schema contract, on their own: no
description may name an R construct, and none may spell a value the way R
does. assert_config_contract() applies both along with the rules about
what a config may demand; this is the entry point for a document those do
not govern – a record, or a result class whose required states what
rtemis always writes.
assert_description_language(schema, id = schema[["$id"]])
schema |
Named list: The generated schema, as |
id |
Character: The schema's |
Every published document is read by R, by the Rust CLI, by the browser and
by a model that writes no code at all, so its prose is part of the interface
rather than a comment on it. A description reading "NULL = unweighted" is
correct roxygen and an invalid instruction to every reader but one, who must
write null; the fix is to say what the absent value means, not to
transliterate the literal.
The schema, invisibly, so it can wrap a write call. Throws with
class simpleError naming every offending description, so one run reports
all of them rather than the first.
EDG
assert_description_language(
list(
type = "object",
properties = list(k = list(type = "integer", description = "Clusters."))
),
"https://schema.rtemis.org/example/v1/schema.json"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.