]> git.koha-community.org Git - koha.git/commit
Bug 30194: Auto generate swagger.yaml
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 24 Mar 2022 07:54:59 +0000 (08:54 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Tue, 29 Mar 2022 14:44:31 +0000 (16:44 +0200)
commite449791a17747e395a8a6d9bd2274b2413d093ff
treef6b76c6bee879da8758cae6caf041cbbe757e216
parent658b292511483f39e24b66b05f2723a4bfac419e
Bug 30194: Auto generate swagger.yaml

It was not sorted correct and had inconsistencies.

use YAML;
use File::Slurp qw( write_file );
my $hash = YAML::LoadFile('api/v1/swagger/swagger.yaml');
YAML::Bless($hash)->keys([qw(swagger basePath definitions parameters paths info tags)]);
my $info = $hash->{info};
YAML::Bless($info)->keys([qw(title version license contact description)]);
my $yaml= YAML::Dump($hash);
$yaml =~ s|'|"|xmsg;
write_file('api/v1/swagger/swagger.yaml', $yaml);

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
api/v1/swagger/swagger.yaml