mikee47 / ConfigDB

Configuration database for Sming
GNU General Public License v3.0
3 stars 1 forks source link

Additional JSON Schema features #47

Open mikee47 opened 2 months ago

mikee47 commented 2 months ago

Some additional JSON schema keywords may be of use. I'll list these here for discussion.

uniqueItems

Can be specified for arrays. Essentially this converts a regular array into a set.

contains, minContains, maxContains

Extended validation. Would probably require callbacks to sort out.

title, description

Support documentation, clarify property usage, etc. title could also be useful for defining unions without requiring a definition. In fact, could that be a better way to define them?

deprecated

Code generator can include corresponding C++ decorations

readOnly, writeOnly

These suggest that accessor types are restricted.

Read-only properties would not have set or reset methods in updater. This might imply const but that keyword has other uses in JSON Schema.

Write-only properties, when would these ever be needed?

$comment

For commenting schema. These could be added to generated code comments. But why have both this and description?