Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-FMSCHEMA-029

A schema table lists the declared fields with their type

When a document's type has a schema, the extension SHALL show a table with the columns Name, Value and Description that lists the declared fields present in the document in schema order, then the other keys in source order, each with a type icon and label before its name, a tooltip on its row, and the properties of composed schemas merged into one field list.

Step 1 of path 1 in StRS-MDOKFSTUDIO-FMSCHEMA-010: from “The type of the document has a schema” to “The fields are listed in schema order”.

Scenarios 7

The situations the tests check; open one to read it.

nominalSchema order
Givena schema declaring type, title and owner (in that order) and a document writing type, owner, title and an extra key zz
Whenthe preview is rendered
Thenthe rows read type, title, owner, zz and the Description column shows each schema description
boundaryRequired but absent field
Giventhe same schema requiring a field that the document lacks
Whenthe preview is rendered
Thenan empty row for the field is appended after the other rows
nominalType icon and label
Givena schema table with a boolean field
Whenthe preview is rendered
Thenthe name cell holds, before the name, the checkbox icon titled Checkbox (at most 1.5 em) and, after the name, the label (boolean)
boundaryDisplayed field type
InputOutcome
a field of type boolean, integer, array, or string with format date-time, or an enumthe labels read boolean, number, list, datetime and enum
a field with a format date, date-time or timethe label reads date, datetime or time (the format test comes before the type test)
a type listthe first non-null type is used
a field declared as type object, a field declared only by anyOf, or a field with no usable type declarationlabelled (unknown), with the icon titled Unknown type
a field with enum or constlabelled enum
nominalRow tooltip
Givena field with title Status, description Lifecycle and enum draft and active
Whenthe preview is rendered
Thenthe row tooltip reads Status, Lifecycle and Allowed: draft, active on separate lines
the same field holding the value retired ends the tooltip with the validation message of the enum
boundaryComposed schemas
InputOutcome
a schema with allOf adding x (required), and if kind is a then ifa (required) else ifb, and a document with kind athe missing required fields are x and ifa
the same document with kind bthe missing required fields are only x, because the then branch is not visited
refusalNames equal to object members
InputOutcome
a schema declaring and requiring toString and a document with a key constructorconstructor is an undeclared key and toString is reported as a missing required field
a schema that really declares constructor and a document that sets itconstructor is a declared present field

Implemented in 2

Tested by 4

Known limits (2)

Replaces

SwRS-MDOKFSTUDIO-FMSCHEMA-030Field names show a type icon and a type label superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-029 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-031The row tooltip lists title, description, allowed values and issues superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-029 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-032Composed schemas are merged into one field list superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-029 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-033The displayed field type follows the schema declaration superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-029 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-034Field names equal to object members are not treated as present superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-029 Markdown file