Skip to content

Commit

Permalink
Fix the list pipelines API
Browse files Browse the repository at this point in the history
  • Loading branch information
sbose2k21 committed Jan 8, 2025
1 parent 4795d03 commit c4d3ce7
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import javax.ws.rs.HttpMethod;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -50,12 +51,13 @@ public void handle(final HttpExchange exchange) throws IOException {
}

try {
final List<PipelineListing> pipelines = pipelinesProvider.getTransformationPipelines()
.keySet()
.stream()
.map(PipelineListing::new)
.collect(Collectors.toList());
LOG.debug("List pipelines request responding with {} pipelines.", pipelines.size());
final List<PipelineListing> pipelines = new ArrayList<>();
// final List<PipelineListing> pipelines = pipelinesProvider.getTransformationPipelines()
// .keySet()
// .stream()
// .map(PipelineListing::new)
// .collect(Collectors.toList());
LOG.debug("List pipelines request responding with {} pipelines.", 0);
final byte[] response = OBJECT_MAPPER.writeValueAsString(Collections.singletonMap("pipelines", pipelines)).getBytes();
exchange.getResponseHeaders().add("Content-Type", "text/plain; charset=UTF-8");
exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, response.length);
Expand Down

0 comments on commit c4d3ce7

Please sign in to comment.