(MAINT) Update OSInfo schema and docs #168
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
This change updates the
Microsoft/OSInfo
resource based on the work for documenting it in MicrosoftDocs/PowerShell-Docs-DSC#181This change:
PR Context
The work to define reference documentation for this resource indicated a few changes could be made to the schema definition:
["null", "string"]
wherenull
didn't have any semantics, it just represented the absence of a value.The canonical schema is generated from the YAML version using the following command:
The schema uses the first sentence from the documentation as the value for the
description
keyword for each property, replacing backticks with single quotes, as thedescription
keyword doesn't reliably render as Markdown for editors that support hover help for JSON schemas. After every description string is the link to that property in the documentation.The
markdownDescription
is a non-standard keyword supported by the JSON and YAML language servers in VS Code. When it is a non-empty string for a schema or subschema, it's rendered and used in the hover text instead of thedescription
keyword.The other major change in the schema is to replace the semantically incorrect multi-type of
null
andstring
with a single type ofstring
. The JSON schema documentation states:For JSON schemas, the
required
keyword indicates whether a property is required. By convention, if a property isn't required and isn't intended to be semanticallynull
, it should be omitted from the JSON representation of the object instance. Usingnull
in a multi-type should be reserved for when anull
value carries specific semantics.