hyperborea-character-sheet/schemas-yaml/classes.pl
2022-04-26 20:20:10 -04:00

18 lines
396 B
Perl

sub {
my $schema = $_->{oneOf} = [];
push @$schema, { enum => [ keys $_->{'$defs'}->%* ] };
for my $generic ( keys $_->{'$defs'}->%* ) {
push @$schema, {
type => 'object',
properties => {
generic => { const => $generic },
subclass => { enum => $_->{'$defs'}{$generic} }
}
}
}
return $_;
}