logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

CSAF::Validator::Base - Base class for CSAF validation

Author

       •   Giuseppe Di Terlizzi <gdt@cpan.org>

Description

ATTRIBUTES
       messages
           ARRAY of validation messages.

       tests
           ARRAY of test IDs.

   METHODS
       CSAF::Validator::Base inherits all methods from CSAF::Base and implements the following new ones.

       add_message
           Add new CSAF::Validator::Message item.

               $v->add_message(
                   type     => 'warning',
                   category => 'optional',
                   path     => '/document/tracking/initial_release_date',
                   code     => '6.2.5',
                   message  => 'Older Initial Release Date than Revision History'
               );

       exec_test
           Execute a single validation test.

               $v->exec_test('6.2.5');

       has_error
           Check if validation have error messages

               my @messages = $v->validate;

               if ($v->has_error) {
                   say "Invalid CSAF document";
                   say $_ for (@messages);
               }

       has_warning
           Check if validation have warning messages

               my @messages = $v->validate;

               if ($v->has_warning) {
                   say "CSAF document with warnings";
                   say $_ for (@messages);
               }

       validate
           Execute all validation tests and return all validation messages.

               my @messages = $v->validate;
               say $_ for (@messages);

Name

       CSAF::Validator::Base - Base class for CSAF validation

Support

Bugs/FeatureRequests
       Please     report    any    bugs    or    feature    requests    through    the    issue    tracker    at
       <https://github.com/giterlizzi/perl-CSAF/issues>.  You will be notified automatically of any progress  on
       your issue.

   SourceCode
       This  is open source software.  The code repository is available for public review and contribution under
       the terms of the license.

       <https://github.com/giterlizzi/perl-CSAF>

           git clone https://github.com/giterlizzi/perl-CSAF.git

Synopsis

           use CSAF::Validator::Base;

           my $v = CSAF::Validator::Base->new( csaf => $csaf );

See Also