class ApiResponseTransformer implements Transformer<Pair<String, ApiResponse>, Response> {

    @Override
    public Response transform(Pair<String, ApiResponse> from) {
        Map<MediaType, Schema> schemaRefs = emptyMap();
        Content content = from.getValue().getContent();
        if (content != null) {
            Set<Map.Entry<String, io.swagger.v3.oas.models.media.MediaType>> entries = resolveReferencedSchemas(content.entrySet());
            schemaRefs = entries.stream().collect(toMap(e -> new MediaType(e.getKey()), e -> mediaTypeTransformer.transform(e.getValue())));
        }
        return new Response(from.getKey(), schemaRefs);
    }

}