protected function analyzeRouteOperationResponses($path, $httpMethod, $operation)
	{
		if (!isset($operation['responses'])) {
			return null;
		}

		$resolvedResponsesReferences = [];

		foreach ($operation['responses'] as $httpCode => $response) {
			if (!isset($response['content'])) {
				continue;
			}

			$mediaType = array_keys($response['content'])[0];

			if (!isset($response['content'][$mediaType]['schema'])) {
				continue;
			}

			// Response object or reference ?
			if (isset($response['content'][$mediaType]['schema']['$ref'])) {
				$resolved = $this->resolveReference($response['content'][$mediaType]['schema']['$ref']);
				$this->makeResponseResource($resolved['name'], $resolved['target']);
				$resolvedResponsesReferences[$httpCode] = $resolved;
			} else {
				//$schema = $response['content'][$mediaType]['schema'];
				// @todo what to do ?
			}
		}

		if (count($resolvedResponsesReferences) == 0) {
			return null;
		}

		return $resolvedResponsesReferences;
	}
protected function analyzeRouteOperationResponses($path, $httpMethod, $operation)
	{
		if (!isset($operation['responses'])) {
			return null;
		}

		$resolvedResponsesReferences = [];

		foreach ($operation['responses'] as $httpCode => $response) {
			if (!isset($response['content'])) {
				continue;
			}

			$mediaType = array_keys($response['content'])[0];

			if (!isset($response['content'][$mediaType]['schema'])) {
				continue;
			}

			// Response object or reference ?
			if (isset($response['content'][$mediaType]['schema']['$ref'])) {
				$resolved = $this->resolveReference($response['content'][$mediaType]['schema']['$ref']);
				$this->makeResponseResource($resolved['name'], $resolved['target']);
				$resolvedResponsesReferences[$httpCode] = $resolved;
			} else {
				//$schema = $response['content'][$mediaType]['schema'];
				// @todo what to do ?
			}
		}

		if (count($resolvedResponsesReferences) == 0) {
			return null;
		}

		return $resolvedResponsesReferences;
	}
protected function analyzeRouteOperationResponses ( $ path , $ httpMethod , $ operation ) { if ( ! isset ( $ operation [ 'responses' ] ) ) { return null ; } $ resolvedResponsesReferences = [ ] ; foreach ( $ operation [ 'responses' ] as $ httpCode => $ response ) { if ( ! isset ( $ response [ 'content' ] ) ) { continue ; } $ mediaType = array_keys ( $ response [ 'content' ] ) [ 0 ] ; if ( ! isset ( $ response [ 'content' ] [ $ mediaType ] [ 'schema' ] ) ) { continue ; } // Response object or reference ?
 if ( isset ( $ response [ 'content' ] [ $ mediaType ] [ 'schema' ] [ '$ref' ] ) ) { $ resolved = $ this -> resolveReference ( $ response [ 'content' ] [ $ mediaType ] [ 'schema' ] [ '$ref' ] ) ; $ this -> makeResponseResource ( $ resolved [ 'name' ] , $ resolved [ 'target' ] ) ; $ resolvedResponsesReferences [ $ httpCode ] = $ resolved ; } else { //$schema = $response['content'][$mediaType]['schema'];
 // @todo what to do ?
 } } if ( count ( $ resolvedResponsesReferences ) == 0 ) { return null ; } return $ resolvedResponsesReferences ; }
Analyze the route operation responses and return te first resolved response reference if exists

@param string $path
@param string $httpMethod
@param mixed[] $operation

@return mixed[]|null Return resolved reference if a response exists
Analyze the route operation responses and return te first resolved response reference if exists