@@ -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 " ;
@@ -70,17 +70,19 @@ auto print_frame(std::ostream &stream,
7070
7171 stream << " Base : " << location.second .base << " \n " ;
7272
73- if (location.second .relative_pointer .empty ()) {
73+ const auto relative_pointer{
74+ location.second .pointer .slice (location.second .relative_pointer )};
75+ if (relative_pointer.empty ()) {
7476 stream << " Relative Pointer :\n " ;
7577 } else {
7678 stream << " Relative Pointer : " ;
77- sourcemeta::core::stringify (location. second . relative_pointer , stream);
79+ sourcemeta::core::stringify (relative_pointer, stream);
7880 stream << " \n " ;
7981 }
8082
8183 stream << " Dialect : " << location.second .dialect << " \n " ;
82- stream << " Base Dialect : " << location. second . base_dialect
83- << " \n " ;
84+ stream << " Base Dialect : "
85+ << sourcemeta::core::to_string (location. second . base_dialect ) << " \n " ;
8486
8587 if (location.second .parent .has_value ()) {
8688 if (location.second .parent .value ().empty ()) {
@@ -125,7 +127,8 @@ auto print_frame(std::ostream &stream,
125127 stream << " Destination : " << reference.second .destination
126128 << " \n " ;
127129 stream << " - (w/o fragment) : "
128- << reference.second .base .value_or (" <NONE>" ) << " \n " ;
130+ << (reference.second .base .empty () ? " <NONE>" : reference.second .base )
131+ << " \n " ;
129132 stream << " - (fragment) : "
130133 << reference.second .fragment .value_or (" <NONE>" ) << " \n " ;
131134 }
@@ -157,17 +160,17 @@ auto sourcemeta::jsonschema::inspect(const sourcemeta::core::Options &options)
157160 const auto identifier{
158161 sourcemeta::core::identify (schema, custom_resolver, dialect)};
159162
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 ());
163+ frame.analyse (schema, sourcemeta::core::schema_walker, custom_resolver,
164+ dialect,
165+
166+ // Only use the file-based URI if the schema has no
167+ // identifier, as otherwise we make the output unnecessarily
168+ // hard when it comes to debugging schemas
169+ ! identifier.empty ()
170+ ? " "
171+ : sourcemeta::core::URI::from_path (
172+ sourcemeta::core::weakly_canonical (schema_path))
173+ .recompose ());
171174 } catch (
172175 const sourcemeta::core::SchemaRelativeMetaschemaResolutionError &error) {
173176 throw FileError<sourcemeta::core::SchemaRelativeMetaschemaResolutionError>(
0 commit comments