Bonfire.API.MastoCompat.Schemas.Mention (Bonfire v1.0.1-social-alpha.28)

View Source

Schema definition for Mastodon Mention entity.

Per the Mastodon OpenAPI spec (mastodon-openapi.yaml lines 1862-1895), a Mention represents a mention of a user within the content of a status.

All fields are required per the spec.

Summary

Functions

Returns the default values for a Mastodon Mention.

Creates a new Mention map with defaults merged with provided attributes.

Required fields for a valid Mastodon Mention.

Validates that a Mention has all required fields.

Functions

defaults()

Returns the default values for a Mastodon Mention.

new(attrs)

Creates a new Mention map with defaults merged with provided attributes.

required_fields()

Required fields for a valid Mastodon Mention.

Per the spec, all four fields are required.

validate(mention)

Validates that a Mention has all required fields.

Returns {:ok, mention} if valid, {:error, {:missing_fields, fields}} otherwise.