Verified Commit 4e63537f authored by Dave Long's avatar Dave Long
Browse files

refactor: #3562477 Drop support for justinrainbow/json-schema:^5

By: bbrala
By: longwave
By: pdureau
By: quietone
parent c19d29d2
Loading
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -208,9 +208,7 @@ public function validateProps(array $context, Component $component): bool {
    $errors = array_filter(
      $this->validator->getErrors(),
      function (array $error) use ($context): bool {
        // Support 5.0 ($error['constraint']) and 6.0
        // ($error['constraint']['name']) at the same time.
        if (($error['constraint']['name'] ?? $error['constraint'] ?? '') !== 'type') {
        if ($error['constraint']['name'] !== 'type') {
          return TRUE;
        }
        return !Element::isRenderArray($context[$error['property']] ?? NULL);
+1 −2
Original line number Diff line number Diff line
@@ -117,8 +117,7 @@ protected function validateResponse(Response $response, Request $request): bool
   *   TRUE if the string is a valid instance of the schema. FALSE otherwise.
   */
  protected function validateSchema(object $schema, mixed $response_data): bool {
    // @phpstan-ignore method.deprecated
    $this->validator->check($response_data, $schema);
    $this->validator->validate($response_data, $schema);
    $is_valid = $this->validator->isValid();
    if (!$is_valid) {
      $this->logger->debug("Response failed validation.\nResponse:\n@data\n\nErrors:\n@errors", [