Class YamlDocumentFormat
- Namespace
- IntentSharp.Guardrails
- Assembly
- IntentSharp.Guardrails.dll
The YAML format for the documents of an IDocumentStore: reads .yaml and .yml documents,
such as rule files, the guardrail manifest, settings or provider files written in YAML, into a JSON tree with the line
of every node and key. AddGuardrails(IServiceCollection, IDocumentStore, params string[])
and WithGuardrailFiles(IntentClientBuilder, IDocumentStore, params string[]) register it
for the client; add it yourself with AddDocumentFormat(IDocumentFormat).
public sealed class YamlDocumentFormat : IDocumentFormat
- Inheritance
-
objectYamlDocumentFormat
- Implements
- Inherited Members
-
object.Equals(object)object.Equals(object, object)object.GetHashCode()object.GetType()object.ReferenceEquals(object, object)object.ToString()
- Extension Methods
Remarks
Plain scalars follow the YAML 1.2 core schema (true, false, null, numbers), while quoted and block
scalars stay text, so data.timeout: 00:00:30 is a string. Several documents in one text (separated by
---) are read as a list. Nesting deeper than 64 levels, an alias that refers to a node holding it, a mapping
key that is not plain text, aliases that expand a document to more than 100,000 nodes, and aliases that repeat more
than 4,000,000 characters of text in it (each use of an alias counts the text it repeats) are refused. Any package
that reads YAML may register a format named "yaml"; the registry keeps the first and ignores the others.
Constructors
- YamlDocumentFormat()
Creates the YAML format.
Properties
- Extensions
Returns
.yamland.yml.
- Name
Returns
"yaml".
Methods
- Parse(string)
Parses YAML text into a tree whose nodes and keys know their lines.