18 lines
396 B
Perl
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 $_;
|
||
|
}
|