Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Commit

Permalink
use the same YAML decoder for JSON translation as we use internally
Browse files Browse the repository at this point in the history
  • Loading branch information
karenetheridge committed Dec 8, 2020
1 parent e906c02 commit 693765b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions misc/pod2githubpages
Expand Up @@ -15,7 +15,7 @@ use Pod::Markdown::Github;
use Class::Method::Modifiers 'around';
use Path::Tiny;
use JSON::MaybeXS;
use YAML::XS;
use YAML::PP;
use List::Util 'any';

my %opts = (
Expand Down Expand Up @@ -144,9 +144,10 @@ foreach my $infile (@all_files) {
path($outfile)->spew($markdown);
}

my $yaml_decoder = YAML::PP->new(boolean => 'JSON::PP');
my $json_encoder = JSON()->new->pretty->indent_length(2)->canonical(1);
foreach my $filename (grep m{^json-schema/[^.]+\.yaml$}, @all_files) {
my $data = YAML::XS::LoadFile($filename);
my $data = $yaml_decoder->load_file($filename);
my $base = path($filename)->basename('.yaml');
my ($type) = $filename =~ m{^json-schema/([^.]+)\.yaml$};
if (any { $type eq $_ } qw(query_params request response common device_report)) {
Expand Down

0 comments on commit 693765b

Please sign in to comment.