public function schemaListPOST(Request $request, Response $response, $args) { $this->logger->info(__CLASS__ . '::' . __FUNCTION__); $parsed = $request->getParsedBody(); $fetch_me = $parsed['fetch_me']; $this->logger->info(__CLASS__ . '::' . __FUNCTION__ . ': fetch_me: ' . $fetch_me); $service = new SchemaService(); $this->logger->info(__CLASS__ . '::' . __FUNCTION__ . ': have SchemaService instance.'); $schemas = []; if ($fetch_me == 'all') { $this->logger->info(__CLASS__ . '::' . __FUNCTION__ . ': fetch all'); $schemas = $service->schemas(); } else { $this->logger->debug(__CLASS__ . '::' . __FUNCTION__ . ': $fetch_me: (mimeType): ' . $fetch_me); $schemas[$fetch_me] = $service->schema($fetch_me); } $this->logger->debug(__CLASS__ . '::' . __FUNCTION__ . ': count($schemas): ' . count($schemas)); $text = serialize($schemas); return $response->getBody()->write($text); }