Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix wrong resolving of responses component using $ref
Browse files Browse the repository at this point in the history
Signed-off-by: Jihyeon Gim <[email protected]>
potatogim committed Oct 12, 2024
1 parent 6677979 commit fe6e598
Showing 4 changed files with 555 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/JSON/Validator/Schema/OpenAPIv3.pm
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ package JSON::Validator::Schema::OpenAPIv3;
use Mojo::Base 'JSON::Validator::Schema::Draft201909';

use JSON::Validator::Util qw(E data_type negotiate_content_type schema_type);
use Mojo::JSON qw(false true);
use Mojo::JSON qw(false true);
use Mojo::Path;

has moniker => 'openapiv3';
@@ -91,8 +91,8 @@ sub parameters_for_response {
my $cache_key = "parameters_for_response:$method:$path:$status";
return $self->{cache}{$cache_key} if $self->{cache}{$cache_key};

my $responses = $self->get([paths => $path, $method, 'responses']);
my $response = $responses->{$status} || $responses->{default};
my $response = $self->get([paths => $path, $method, 'responses', $status])
|| $self->get([paths => $path, $method, 'responses', 'default']);
return undef unless $response;

my @parameters;
Loading

0 comments on commit fe6e598

Please sign in to comment.