docs: ♻️ Removed usage of null author, mandate usage of null for unset fields

This commit is contained in:
Jesse Wierzbinski 2025-06-07 20:40:10 +02:00
parent b2f98c1311
commit e6f7a27d3e
No known key found for this signature in database
5 changed files with 9 additions and 13 deletions

View file

@ -18,6 +18,8 @@ This page lists changes since Working Draft 3. {{ className: 'lead' }}
- Every field that used to be a URI now uses that entity's `id` field.
- New endpoints have been defined under `/.versia/v0.6/` to fetch entities by their `id`.
- Added [References](/types#reference) as a way to refer to other entities.
- Mandated the usage of `null` for optional fields that are not set, instead of omitting them.
- Changed usage of "`null` authors" to simply being an optional field.
## Since WD 4

View file

@ -24,8 +24,8 @@ Having the authorization is defined as:
<Row>
<Col>
<Properties name="Delete">
<Property name="author" type="Reference | null" required={true} typeLink="/types#reference">
[Reference](/types#reference) to the `User` who is deleting the entity. [Can be set to `null` to represent the instance](/entities/instance-metadata#the-null-author).
<Property name="author" type="Reference" required={true} typeLink="/types#reference">
[Reference](/types#reference) to the `User` who is deleting the entity.
</Property>
<Property name="deleted_type" type="string" required={true}>
Type of the entity being deleted.

View file

@ -7,12 +7,6 @@ export const metadata = {
Contains metadata about a Versia instance, such as capabilities and endpoints. {{ className: 'lead' }}
## The `null` Author
On some entities that have an `author` field, the `author` can be `null` to represent the instance itself as the author (like ActivityPub's Server Actors).
Check the entity's documentation page to see if it supports this (it will be noted in the `author` field).
## Entity Definition
<Row>

View file

@ -12,7 +12,7 @@ Entities are the foundation of the Versia protocol. A similar concept to entitie
An entity is a simple JSON object that represents a core data structure in Versia. Entities are used to represent various types of data, such as users, notes, and more. Each entity has a unique `id` property that is used to identify it within the instance.
Any field in an entity not marked as `required` may be omitted or set to `null`.
Any field in an entity not marked as `required` may be set to `null`. These fields **must not** be omitted: they must be present with a `null` value if not set.
<Row>
<Col>

View file

@ -16,8 +16,8 @@ Collections are a way to represent paginated groups of entities. They are used e
<Row>
<Col>
<Properties name="Collection">
<Property name="author" type="Reference | null" required={true} typeLink="/types#reference">
[Reference](/types#reference) to the author of the collection. Usually the user who owns the collection. [Can be set to `null` to represent the instance](/entities/instance-metadata#the-null-author).
<Property name="author" type="Reference" required={false} typeLink="/types#reference">
[Reference](/types#reference) to the author of the collection. Usually the user who "owns" the collection.
</Property>
<Property name="total" type="number" required={true} numberType="u64">
Total number of entities in the collection, across all pages.
@ -64,8 +64,8 @@ URI Collections are identical to regular collections, but they contain only URIs
<Row>
<Col>
<Properties name="URICollection">
<Property name="author" type="Reference | null" required={true} typeLink="/types#reference">
[Reference](/types#reference) to the author of the collection. Usually the user who owns the collection. [Can be set to `null` to represent the instance](/entities/instance-metadata#the-null-author).
<Property name="author" type="Reference" required={false} typeLink="/types#reference">
[Reference](/types#reference) to the author of the collection. Usually the user who owns the collection.
</Property>
<Property name="total" type="number" required={true} numberType="u64">
Total number of entities in the collection, across all pages.