@@ -300,7 +300,6 @@ sub traverse ($self, $schema_reference, $config_override = {}) {
300
300
initial_schema_uri => $initial_uri , # the canonical URI as of the start of this method or last $id
301
301
traversed_schema_path => $initial_path , # the accumulated traversal path as of the start or last $id
302
302
schema_path => ' ' , # the rest of the path, since the start of this method or last $id
303
- effective_base_uri => Mojo::URL-> new(' ' ),
304
303
errors => [],
305
304
identifiers => {},
306
305
subschemas => [],
@@ -348,25 +347,27 @@ sub traverse ($self, $schema_reference, $config_override = {}) {
348
347
sub evaluate ($self , $data , $schema_reference , $config_override = {}) {
349
348
croak ' evaluate called in void context' if not defined wantarray ;
350
349
351
- my $initial_path = $config_override -> {traversed_schema_path } // ' ' ;
352
- my $effective_base_uri = Mojo::URL-> new($config_override -> {effective_base_uri }//' ' );
350
+ my %overrides = %$config_override ;
351
+ delete @overrides {qw( validate_formats validate_content_schemas short_circuit collect_annotations scalarref_booleans stringy_numbers strict callbacks effective_base_uri data_path traversed_schema_path _strict_schema_data) };
352
+ croak join (' , ' , sort keys %overrides ), ' not supported as a config override in evaluate'
353
+ if keys %overrides ;
353
354
354
355
my $state = {
355
356
data_path => $config_override -> {data_path } // ' ' ,
356
- traversed_schema_path => $initial_path , # the accumulated path as of the start of evaluation or last $id or $ref
357
+ traversed_schema_path => $config_override -> { traversed_schema_path } // ' ' , # the accumulated path as of the start of evaluation or last $id or $ref
357
358
initial_schema_uri => Mojo::URL-> new, # the canonical URI as of the start of evaluation or last $id or $ref
358
359
schema_path => ' ' , # the rest of the path, since the start of evaluation or last $id or $ref
359
- effective_base_uri => $effective_base_uri , # resolve locations against this for errors and annotations
360
360
errors => [],
361
361
depth => 0,
362
362
configs => {},
363
363
};
364
364
365
- # note this is not quite the same list as what we use when defining $state below
366
- my %overrides = %$config_override ;
367
- delete @overrides {qw( validate_formats validate_content_schemas short_circuit collect_annotations scalarref_booleans stringy_numbers strict callbacks effective_base_uri data_path traversed_schema_path _strict_schema_data) };
368
- croak join (' , ' , sort keys %overrides ), ' not supported as a config override in evaluate'
369
- if keys %overrides ;
365
+ # resolve locations against this for errors and annotations, if locations are not already absolute
366
+ if (length $config_override -> {effective_base_uri }) {
367
+ $state -> {effective_base_uri } = Mojo::URL-> new($config_override -> {effective_base_uri });
368
+ croak ' it is meaningless for effective_base_uri to have a fragment'
369
+ if defined $state -> {effective_base_uri }-> fragment;
370
+ }
370
371
371
372
my $valid ;
372
373
try {
0 commit comments