hyperborea-character-sheet/schemas-yaml/classes.pl

18 lines
396 B
Perl
Raw Normal View History

2022-04-26 20:24:37 +00:00
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 $_;
}