code: public static ServiceEndpoint decodeMetadata(String metadata) {
      try {
        return objectMapper.readValue(metadata, ServiceEndpoint.class);
      } catch (IOException e) {
        LOGGER.error("Failed to read metadata: " + e);
        return null;
      }
    }
docs: Decodes metadata into {@link ServiceEndpoint}.
  
  @param metadata - raw metadata to decode from.
  @return decoded {@link ServiceEndpoint}. In case of deserialization error returns {@code null}