Method Read
- Namespace
- IntentSharp.Catalog
- Assembly
- IntentSharp.Catalog.dll
Read(string, string)
Reads JSON or YAML intent file text: one definition object or a list of them (YAML may also hold several
documents). The format follows the extension of path: .json is JSON (comments and
trailing commas allowed), .yaml and .yml are YAML. Content never throws: unknown properties, wrong
types, invalid rules and duplicate names are returned as problems with the line, and a definition with any problem
is left out while the others still load. Each definition's Source is
path.
public static IntentFileReadResult Read(string text, string path)
Parameters
textstringThe text of the file.
pathstringA name for the text, such as
Orders.intent.json: it chooses the format and is the source of every definition and problem.
Returns
- IntentFileReadResult
The valid definitions, in the order of the text, and the problems.
Exceptions
- ArgumentNullException
textorpathis null.- ArgumentException
pathdoes not end in.json,.yamlor.yml.