@@ -50,7 +50,7 @@ auto print_frame(std::ostream &stream,
5050 }
5151
5252 stream << " Root : "
53- << location. second . root . value_or ( " <ANONYMOUS>" ) << " \n " ;
53+ << (frame. root (). empty () ? " <ANONYMOUS>" : frame. root () ) << " \n " ;
5454
5555 if (location.second .pointer .empty ()) {
5656 stream << " Pointer :\n " ;
@@ -60,7 +60,8 @@ auto print_frame(std::ostream &stream,
6060 stream << " \n " ;
6161 }
6262
63- const auto position{positions.get (location.second .pointer )};
63+ const auto position{
64+ positions.get (sourcemeta::core::to_pointer (location.second .pointer ))};
6465 if (position.has_value ()) {
6566 stream << " File Position : " << std::get<0 >(position.value ())
6667 << " :" << std::get<1 >(position.value ()) << " \n " ;
@@ -70,17 +71,19 @@ auto print_frame(std::ostream &stream,
7071
7172 stream << " Base : " << location.second .base << " \n " ;
7273
73- if (location.second .relative_pointer .empty ()) {
74+ const auto relative_pointer{
75+ location.second .pointer .slice (location.second .relative_pointer )};
76+ if (relative_pointer.empty ()) {
7477 stream << " Relative Pointer :\n " ;
7578 } else {
7679 stream << " Relative Pointer : " ;
77- sourcemeta::core::stringify (location. second . relative_pointer , stream);
80+ sourcemeta::core::stringify (relative_pointer, stream);
7881 stream << " \n " ;
7982 }
8083
8184 stream << " Dialect : " << location.second .dialect << " \n " ;
82- stream << " Base Dialect : " << location. second . base_dialect
83- << " \n " ;
85+ stream << " Base Dialect : "
86+ << sourcemeta::core::to_string (location. second . base_dialect ) << " \n " ;
8487
8588 if (location.second .parent .has_value ()) {
8689 if (location.second .parent .value ().empty ()) {
@@ -114,7 +117,8 @@ auto print_frame(std::ostream &stream,
114117 stream << " Type : Dynamic\n " ;
115118 }
116119
117- const auto position{positions.get (reference.first .second )};
120+ const auto position{
121+ positions.get (sourcemeta::core::to_pointer (reference.first .second ))};
118122 if (position.has_value ()) {
119123 stream << " File Position : " << std::get<0 >(position.value ())
120124 << " :" << std::get<1 >(position.value ()) << " \n " ;
@@ -125,7 +129,8 @@ auto print_frame(std::ostream &stream,
125129 stream << " Destination : " << reference.second .destination
126130 << " \n " ;
127131 stream << " - (w/o fragment) : "
128- << reference.second .base .value_or (" <NONE>" ) << " \n " ;
132+ << (reference.second .base .empty () ? " <NONE>" : reference.second .base )
133+ << " \n " ;
129134 stream << " - (fragment) : "
130135 << reference.second .fragment .value_or (" <NONE>" ) << " \n " ;
131136 }
@@ -157,17 +162,17 @@ auto sourcemeta::jsonschema::inspect(const sourcemeta::core::Options &options)
157162 const auto identifier{
158163 sourcemeta::core::identify (schema, custom_resolver, dialect)};
159164
160- frame.analyse (
161- schema, sourcemeta::core::schema_walker, custom_resolver, dialect,
162-
163- // Only use the file-based URI if the schema has no identifier,
164- // as otherwise we make the output unnecessarily hard when it
165- // comes to debugging schemas
166- identifier.has_value ()
167- ? std::optional<sourcemeta::core::JSON::String>(std:: nullopt )
168- : sourcemeta::core::URI::from_path (
169- sourcemeta::core::weakly_canonical (schema_path))
170- .recompose ());
165+ frame.analyse (schema, sourcemeta::core::schema_walker, custom_resolver,
166+ dialect,
167+
168+ // Only use the file-based URI if the schema has no
169+ // identifier, as otherwise we make the output unnecessarily
170+ // hard when it comes to debugging schemas
171+ ! identifier.empty ()
172+ ? " "
173+ : sourcemeta::core::URI::from_path (
174+ sourcemeta::core::weakly_canonical (schema_path))
175+ .recompose ());
171176 } catch (
172177 const sourcemeta::core::SchemaRelativeMetaschemaResolutionError &error) {
173178 throw FileError<sourcemeta::core::SchemaRelativeMetaschemaResolutionError>(
0 commit comments