Skip to content

Commit eaf82e5

Browse files
non-breaking changes that adjust for JSMD changes re original_uri
1 parent 7e0f1a2 commit eaf82e5

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

dist.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ dir = share
3232

3333
[Prereqs / RuntimeRequires]
3434
JSON::Schema::Modern = 0.603 ; THAW, FREEZE fixes; recommended_response default
35+
JSON::Schema::Modern::Document = 0.608 ; original_uri now exists separately from canonical_uri
3536

3637
[Prereqs / RuntimeSuggests]
3738
Class::XSAccessor = 0

lib/JSON/Schema/Modern/Document/OpenAPI.pm

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ sub traverse ($self, $evaluator, $config_override = {}) {
8686

8787
my $schema = $self->schema;
8888
my $state = {
89-
initial_schema_uri => $self->canonical_uri,
89+
# initial_schema_uri calculated from '$self' below
9090
traversed_schema_path => '',
9191
schema_path => '',
9292
data_path => '',
@@ -138,6 +138,9 @@ sub traverse ($self, $evaluator, $config_override = {}) {
138138
return $state;
139139
}
140140

141+
# in v3.2, we will use the resolved form of the uri in '$self'
142+
$self->_set_canonical_uri($state->{initial_schema_uri} = $self->original_uri);
143+
141144
# /jsonSchemaDialect: https://spec.openapis.org/oas/v3.1#specifying-schema-dialects
142145
{
143146
my $json_schema_dialect = $self->json_schema_dialect // $schema->{jsonSchemaDialect};
@@ -478,6 +481,8 @@ This is the identifier that the document is known by, which is used to resolve a
478481
keywords in the document (unless overridden by a subsequent C<$id> in a schema).
479482
See L<§4.6/https://spec.openapis.org/oas/v3.1.1#relative-references-in-api-description-uris>.
480483
484+
See also L</retrieval_uri>.
485+
481486
=head2 metaschema_uri
482487
483488
The URI of the schema that describes the OpenAPI document itself. Defaults to
@@ -505,6 +510,14 @@ longer be assumed.
505510
506511
This class inherits all methods from L<JSON::Schema::Modern::Document>. In addition:
507512
513+
=head2 retrieval_uri
514+
515+
Also available as L<JSON::Schema::Modern::Document/original_uri>, this is known as the "retrieval
516+
URI" in the OAS specification: the URL the document was originally sourced from, or the URI that
517+
was used to add the document to the L<OpenAPI::Modern> instance.
518+
519+
In OpenAPI version 3.1.x, this is the same as L</canonical_uri>.
520+
508521
=head2 get_operationId_path
509522
510523
Returns the json pointer location of the operation containing the provided C<operationId> (suitable

0 commit comments

Comments
 (0)