File tree Expand file tree Collapse file tree 4 files changed +21
-13
lines changed Expand file tree Collapse file tree 4 files changed +21
-13
lines changed Original file line number Diff line number Diff line change @@ -75,9 +75,10 @@ auto find_anchors(const sourcemeta::core::JSON &schema,
75
75
assert (schema.at (" $id" ).is_string ());
76
76
const sourcemeta::core::URI identifier (schema.at (" $id" ).to_string ());
77
77
if (identifier.is_fragment_only ()) {
78
- result.insert (
79
- {sourcemeta::core::JSON::String{identifier.fragment ().value ()},
80
- AnchorType::Static});
78
+ result.insert ({sourcemeta::core::JSON::String{
79
+ identifier.fragment () ? identifier.fragment ().value ()
80
+ : " what should we have here?" },
81
+ AnchorType::Static});
81
82
}
82
83
}
83
84
}
@@ -90,9 +91,10 @@ auto find_anchors(const sourcemeta::core::JSON &schema,
90
91
assert (schema.at (" id" ).is_string ());
91
92
const sourcemeta::core::URI identifier (schema.at (" id" ).to_string ());
92
93
if (identifier.is_fragment_only ()) {
93
- result.insert (
94
- {sourcemeta::core::JSON::String{identifier.fragment ().value ()},
95
- AnchorType::Static});
94
+ result.insert ({sourcemeta::core::JSON::String{
95
+ identifier.fragment () ? identifier.fragment ().value ()
96
+ : " what should we have here?" },
97
+ AnchorType::Static});
96
98
}
97
99
}
98
100
}
Original file line number Diff line number Diff line change @@ -62,8 +62,10 @@ static auto id_keyword(const std::string &base_dialect) -> std::string {
62
62
auto sourcemeta::core::identify (
63
63
const sourcemeta::core::JSON &schema, const SchemaResolver &resolver,
64
64
const SchemaIdentificationStrategy strategy,
65
- const std::optional<std::string> &default_dialect,
66
- const std::optional<std::string> &default_id)
65
+ const std::optional<std::string>
66
+ &default_dialect, // NOLINT(bugprone-easily-swappable-parameters)
67
+ const std::optional<std::string>
68
+ &default_id) // NOLINT(bugprone-easily-swappable-parameters)
67
69
-> std::optional<std::string> {
68
70
std::optional<std::string> maybe_base_dialect;
69
71
Original file line number Diff line number Diff line change
1
+ #include < optional>
1
2
#include < sourcemeta/core/jsonschema.h>
2
3
3
4
#include < algorithm> // std::max, std::sort
@@ -44,11 +45,13 @@ auto walk(const std::optional<sourcemeta::core::Pointer> &parent,
44
45
const auto is_schema_resource{level == 0 || id.has_value ()};
45
46
const auto current_dialect{is_schema_resource ? maybe_current_dialect.value ()
46
47
: dialect};
47
- const auto current_base_dialect{
48
- is_schema_resource
49
- ? sourcemeta::core::base_dialect (subschema, resolver, current_dialect)
50
- .value ()
51
- : base_dialect};
48
+ const auto opt_current_base_dialect =
49
+ sourcemeta::core::base_dialect (subschema, resolver, current_dialect);
50
+ const auto current_base_dialect{is_schema_resource
51
+ ? (opt_current_base_dialect
52
+ ? opt_current_base_dialect.value ()
53
+ : base_dialect)
54
+ : base_dialect};
52
55
53
56
const auto vocabularies{sourcemeta::core::vocabularies (
54
57
resolver, current_base_dialect, current_dialect)};
Original file line number Diff line number Diff line change @@ -620,6 +620,7 @@ auto URI::relative_to(const URI &base) -> URI & {
620
620
return *this ;
621
621
}
622
622
623
+ // NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
623
624
auto URI::rebase (const URI &base, const URI &new_base) -> URI & {
624
625
this ->relative_to (base);
625
626
if (!this ->is_relative ()) {
You can’t perform that action at this time.
0 commit comments