private function filterConstraintsForSchema(array $constraints, stdClass $schema)
    {
        $filtered = [];

        foreach ($constraints as $constraint) {
            foreach ($constraint->keywords() as $keyword) {
                if (property_exists($schema, $keyword)) {
                    $filtered[] = $constraint;
                    break;
                }
            }
        }

        return $filtered;
    }