docs for ::Validate
This commit is contained in:
parent
ec4fee9e69
commit
92d3e10756
@ -3,13 +3,19 @@ package App::Changelord::Command::Validate;
|
||||
use 5.36.0;
|
||||
|
||||
use Moo;
|
||||
use CLI::Osprey;
|
||||
use CLI::Osprey
|
||||
doc => 'validate the changelog yaml',
|
||||
description_pod => <<'END';
|
||||
Validate the changelog against the JSON Schema used by changelord.
|
||||
END
|
||||
|
||||
use Path::Tiny;
|
||||
use JSON;
|
||||
use YAML::XS;
|
||||
use JSON::Schema::Modern;
|
||||
|
||||
with 'App::Changelord::Role::Changelog';
|
||||
|
||||
option json => (
|
||||
is => 'ro',
|
||||
default => 0,
|
||||
@ -24,7 +30,7 @@ sub run($self) {
|
||||
my $result = JSON::Schema::Modern->new(
|
||||
output_format => 'detailed',
|
||||
)->evaluate(
|
||||
$self->parent_command->changelog,
|
||||
$self->changelog,
|
||||
YAML::XS::Load($schema),
|
||||
);
|
||||
|
||||
|
@ -42,12 +42,14 @@ properties:
|
||||
- type: object
|
||||
additionalProperties: false
|
||||
properties:
|
||||
version: { type: string }
|
||||
version: { type: [ 'null', string ] }
|
||||
date: { type: ['null',string] }
|
||||
changes: { type: 'array', items: { $ref: '#/$defs/change' } }
|
||||
$defs:
|
||||
change:
|
||||
type: object
|
||||
oneOf:
|
||||
- type: string
|
||||
- type: object
|
||||
required: [ desc ]
|
||||
additionalProperties: false
|
||||
properties:
|
||||
|
Loading…
Reference in New Issue
Block a user