serviceEndpointToJsonElement

fun serviceEndpointToJsonElement(endpoint: ServiceEndpoint): JsonElement

Converts a ServiceEndpoint to a JsonElement using the canonical DID document wire rules. Numbers are emitted as their original JSON token where possible; primitives recovered from ServiceEndpoint.ObjectEndpoint/ServiceEndpoint.ArrayEndpoint follow the same rules as the shared DID document producer.