code: public function invalidResource(
          string $path,
          ?string $detail = null,
          array $failed = []
      ): ErrorInterface
      {
          return new Error(
              null,
              null,
              Response::HTTP_UNPROCESSABLE_ENTITY,
              $this->trans('resource_invalid', 'code'),
              $this->trans('resource_invalid', 'title'),
              $detail ?: $this->trans('resource_invalid', 'detail'),
              $this->pointer($path),
              $failed ? compact('failed') : null
          );
      }
docs: Create an error for an invalid resource.
  
  @param string $path
  @param string|null $detail
  the validation message (already translated).
  @param array $failed
  rule failure details
  @return ErrorInterface