Skip to content

Conversation

hoppfrosch
Copy link

Within catalyst debug-panel occurs the following error

Use of uninitialized value in repeat (x)
        at Catalyst::Controller::Swagger::api_docs(C:/perl/site/lib/Catalyst/Controller/Swagger.pm:48)

This bugfix avoids this warnings

@@ -46,8 +46,8 @@ sub api_docs : Local {
my @path;
for my $chain_part (@{$expanded->chain}) {
push @path, join('/',$chain_part->attributes->{PathPart}[0],
($chain_part->attributes->{CaptureArgs} ? join('/',('*') x $chain_part->attributes->{CaptureArgs}[0]) : ()),
($chain_part->attributes->{Args} ? join('/',('*') x $chain_part->attributes->{Args}[0]) : ()),
($chain_part->attributes->{CaptureArgs}[0] ? join('/',('*') x $chain_part->attributes->{CaptureArgs}[0]) : ()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should check ref eq 'ARRAY' here? Or if something has changed in Catalyst that would make these warnings surface.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just made it work without warning. You're right: it's not the best solution ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants