Lucas_Werkmeister_WMDE added a comment.

  We already have the constraint violation message as an object wrapping the 
cache and type-tagged parameters (with types like “quantity”, “list of item 
IDs”, etc.), which we then render into HTML:
  
  name=CheckResultsRenderer::checkResultToArray()
                $message = $checkResult->getMessage();
                if ( $message ) {
                        $result['message-html'] = 
$this->violationMessageRenderer->render( $message );
                }
  
  It should be relatively straightforward to add the `$message` as an array as 
well (message key and parameters).
  
  This should be optional, controlled by an API parameter, and not enabled by 
default: for API requests from the constraints “gadget”, we don’t need this 
data, it would just be wasted bandwidth.
  
  Also, the violation message structure has been internal to the extension so 
far, and I think I’d prefer to keep it that way. If this is going to be 
controlled by an API parameter anyway, then I’d like to add some disclaimer 
like “beware that this part of the API response is not covered by the Stable 
Interface Policy 
<https://www.wikidata.org/wiki/Wikidata:Stable_Interface_Policy>” to the 
documentation of the parameter. We’d allow people to opt into getting the 
structured version of the message, and process it as they see fit, in the 
understanding that we may change how exactly the message looks like.

TASK DETAIL
  https://phabricator.wikimedia.org/T289710

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: Lucas_Werkmeister_WMDE, Aklapper, Hjfocs, Invadibot, maantietaja, 
Akuckartz, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, Esc3300, 
LawExplorer, _jensen, rosalieper, Agabi10, Scott_WUaS, abian, Wikidata-bugs, 
aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list -- wikidata-bugs@lists.wikimedia.org
To unsubscribe send an email to wikidata-bugs-le...@lists.wikimedia.org

Reply via email to