21 private readonly
bool $warningsAsError,
23 parent::__construct( $main, $format );
28 if ( !$result->getResultData(
'error' ) && !$result->getResultData(
'errors' ) ) {
30 $warnings = $result->removeValue(
'warnings',
null );
31 if ( $this->warningsAsError && $warnings ) {
33 'apierror-opensearch-json-warnings',
35 [
'warnings' => $warnings ]
40 $remove = array_keys( array_diff_key(
41 $result->getResultData(),
42 [ 0 =>
'search', 1 =>
'terms', 2 =>
'descriptions', 3 =>
'urls' ]
44 foreach ( $remove as $key ) {
45 $result->removeValue( $key,
null );
54class_alias( ApiOpenSearchFormatJson::class,
'ApiOpenSearchFormatJson' );
This is the main API class, used for both external and internal processing.