๐ Avatar schemas
Avatar provides one reusable schema for the persisted file reference consumed by owner schemas and Avatar blocks. It is not the normalized response shape, which exposes {type, url}.
Inventoryโ
| Export | Request location | Contract |
|---|---|---|
avatarSchema | N/A โ reusable stored object | Requires a UUID-formatted string objectId and string type; rejects additional properties. Used by Profile creation and update request schemas. |
Detailsโ
avatarSchemaโ
Definition
Persist a value shaped as {objectId, type}. objectId must use the validatorโs uuid format and type is any string; this schema does not constrain it to a MIME-type allowlist. Because additionalProperties is false, the stored reference cannot include an extra field. Owners that have no avatar must allow null in their enclosing schema; Profile schemas are one consumer. Before responding, use normalizeAvatarOfOwner or normalizeAvatarsOfOwners to replace objectId with a signed url.
| Location | Field | Type | Required | Constraints |
|---|---|---|---|---|
| N/A โ stored object | objectId | string | Yes | uuid format |
| N/A โ stored object | type | string | Yes | No MIME-type enum or pattern is enforced |
additionalProperties is false. The schema is composed as oneOf: [avatarSchema, {type: 'null'}] by Profileโs profileSchema and updateProfileSchema, so avatar itself is optional in those enclosing request bodies and may be null.
Used by feature: Profileโs createProfileFeature and updateProfileFeature.
Used by route: POST /profiles and PATCH /profiles/:profileId.View complete source