ServiceEndpoint

@Serializable(with = ServiceEndpointSerializer::class)
sealed class ServiceEndpoint

Type-safe model for DidService.serviceEndpoint.

The W3C DID Core spec allows serviceEndpoint to be:

  • A string (URL)

  • An object (Map)

  • An array of strings/objects

This sealed type captures those variants while ServiceEndpointSerializer guarantees the on-the-wire JSON stays byte-compatible (a bare string stays a string, an object stays an object, and an array stays an array).

Inheritors

Types

Link copied to clipboard
data class ArrayEndpoint(val endpoints: List<ServiceEndpoint>) : ServiceEndpoint

Service endpoint as an array of endpoints (can be mixed types).

Link copied to clipboard
object Companion
Link copied to clipboard
data class ObjectEndpoint(val data: Map<String, Any?>) : ServiceEndpoint

Service endpoint as an object (map of key-value pairs).

Link copied to clipboard
data class Url(val url: String) : ServiceEndpoint

Service endpoint as a single URL string.

Functions

Link copied to clipboard

Converts a ServiceEndpoint back to a raw value (String, Map, or List).