· one of 0 variants:
The none type accepts no values. Its schema is {"anyOf": []}: there are no alternatives a value can match. Reference it as {"type": "hm://hyper.media/none"}. It is a schema built from the existing union vocabulary, not a new data kind.
Unlike none, the null type and the bare literal schema null accept exactly one value: null. The any type accepts every Hypermedia value.
A list whose items schema is none can only be empty. A map whose values schema is none can only be empty. On a struct, values applies to additional fields, so setting it to none forbids fields outside properties. An optional field typed none must be absent; a required field typed none makes the struct impossible to satisfy.
The TypeScript generator emits HMNone = never. The type has no default value for editors to create. Its formal schema is attached as the schemaDefinition in this document's metadata.
See also
Union schema: a value must match at least one alternative.
Null: the type with exactly one value.
Any: the type that accepts every value.
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime