NodeInfo

com.worxbend.codeberg4s.miscellaneous.NodeInfo
final case class NodeInfo

The federation document GET /nodeinfo answers: what software this instance runs, what it speaks, and how much it is used.

NodeInfo is a cross-project schema — Mastodon, PeerTube, Forgejo and the rest of the fediverse all serve it — which is exactly why it is modelled here rather than handed back as a string: a caller reaching for nodeinfo is trying to branch on software.name or on protocols, and doing that against raw JSON puts the schema's spelling into their code instead of into this library's.

'''The wire keys are camelCase, not snake_case.''' openRegistrations, localPosts, activeHalfyear — this is the one model in the library whose spellings are not Forgejo's own, because the schema is not Forgejo's own. Rule 4 of com.worxbend.codeberg4s.codec.WireConventions still holds: each of those names is written exactly once, in the DTO's reader.

'''Derived from spec/swagger.v1.json's NodeInfo definition, not from a captured response.''' golden/MANIFEST.md records that GET /nodeinfo answered 404 on codeberg.org with a '''plain-text''' body, so no fixture exists and a caller must expect this endpoint to be absent on a deployment that does not federate.

'''metadata is not modelled.''' The schema types it as a free-form JSON object, and the domain module depends on nothing beyond the standard library, so there is no honest representation for it here — a Map[String, String] would silently drop every non-string entry. Forgejo populates it with an empty object.

Value parameters

hasOpenRegistrations

whether anyone may create an account without an invitation

protocols

the federation protocols the instance speaks, activitypub for a Forgejo that federates. Empty when the instance listed none

services

the third-party services the instance can exchange content with

software

which forge, and which release of it. Required for the same reason a caller made the request

usage

the instance's own account and activity counts

version

the NodeInfo schema version this document conforms to, "2.1" for Forgejo. Required: without it a consumer cannot know how to read the rest, which is the whole point of the field

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product