Use case StRS-MDOKFSTUDIO-FMSCHEMA-006
A document finds its schema and schema problems are reported
As a writer of Open Knowledge Format documents, I get schema-aware metadata simply by setting the type and learn when no schema is found; as a schema author, I write schemas in the format I prefer, reuse shared definitions, see at once that my schema is broken and why, and see my edits applied to my documents.
Use case diagram
How it is split
This use case (StRS) is reached by 2 paths, one per coloured line. A path goes from one situation (circle) to the next; each step (pill) is a behaviour (SwRS) with its own tests.
path 1: A schema is found and loaded path 2: No schema is looked up other outcomeone dot = one scenario checked: nominal boundary refusal
Path 1: A schema is found and loaded
- The frontmatter has a string `type`SwRS-MDOKFSTUDIO-FMSCHEMA-019 no schema folder, or no file for the typeSwRS-MDOKFSTUDIO-FMSCHEMA-019 · 3 tests the page walks up to the nearest `_schema` folder and picks the file named by the type
- A schema file is foundSwRS-MDOKFSTUDIO-FMSCHEMA-023 a schema that cannot be parsed shows a row of the tableSwRS-MDOKFSTUDIO-FMSCHEMA-023 · 5 tests the page loads it from YAML, JSON or JSON5, inlining its relative `$ref` references
- The schema is loadedSwRS-MDOKFSTUDIO-FMSCHEMA-027 · 2 tests an edit of the schema is used at the next analysis, without refreshing the open preview by itself
- The next analysis uses the new content of the schema
Path 2: No schema is looked up
- The frontmatter has no string `type`SwRS-MDOKFSTUDIO-FMSCHEMA-005 markup in a name or a value is shown as textSwRS-MDOKFSTUDIO-FMSCHEMA-005 · 6 tests the page shows a two-column Names and Values table of the keys in source order
- The generic Names and Values table is shown
This map has 353 different ways through it in 8 steps or fewer. Instead of testing each one end to end, the 4 behaviours on the map are tested one by one, with 25 scenarios.
Behaviours of this use case
SwRS-MDOKFSTUDIO-FMSCHEMA-005Without a schema the table lists the keys in source order, escaped 6 testsSwRS-MDOKFSTUDIO-FMSCHEMA-019A typed document finds its schema in the nearest schema folder 3 testsSwRS-MDOKFSTUDIO-FMSCHEMA-023Schemas in YAML, JSON or JSON5 with relative references compile or report a row 5 testsSwRS-MDOKFSTUDIO-FMSCHEMA-027Schema edits are picked up on the next analysis 2 tests
SwRS-MDOKFSTUDIO-FMSCHEMA-020The schema file is chosen by the type name superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-019 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-021A missing schema file is reported as an info row superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-019 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-022Schema lookup is off in Restricted Mode and for standalone files superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-019 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-024Relative schema references are inlined from the schema folder superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-023 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-025A schema that cannot be parsed gives a warning row superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-023 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-026A schema that cannot be compiled gives a red row superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-023 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-028Editing a schema does not refresh open previews by itself superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-027 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-077The no-lookup info row appears only for typed documents superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-019 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-078At most 64 resolved schemas are kept deprecated deprecated Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-088The generic table is shown when no schema lookup is made superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-005 Markdown file