Skip to content

Commit abf2ee3

Browse files
authored
Remove instance location information from the inspect command (#597)
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent 0503ee9 commit abf2ee3

27 files changed

Lines changed: 247 additions & 1065 deletions

DEPENDENCIES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
vendorpull https://github.com/sourcemeta/vendorpull 1dcbac42809cf87cb5b045106b863e17ad84ba02
2-
core https://github.com/sourcemeta/core 9985d96665aae0a8dfabf63f59b0732b92c64771
2+
core https://github.com/sourcemeta/core 94ff49bd58ca63c5e5a7fb2435b3bc72872517c4
33
jsonbinpack https://github.com/sourcemeta/jsonbinpack 8fae212dc7ec02af4bb0cd4e7fccd42a2471f1c1
44
blaze https://github.com/sourcemeta/blaze 8dba65f8aebfe1ac976168b76e01c20dd406c517
55
hydra https://github.com/sourcemeta/hydra af9f2c54709d620872ead0c3f8f683c15a0fa702

src/command_inspect.cc

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,6 @@ auto print_frame(std::ostream &stream,
9494
stream << " Parent : <NONE>\n";
9595
}
9696

97-
const auto &instance_locations{frame.instance_locations(location.second)};
98-
if (!instance_locations.empty()) {
99-
for (const auto &instance_location : instance_locations) {
100-
if (instance_location.empty()) {
101-
stream << " Instance Location :\n";
102-
} else {
103-
stream << " Instance Location : ";
104-
sourcemeta::core::stringify(instance_location, stream);
105-
stream << "\n";
106-
}
107-
}
108-
}
109-
11097
if (std::next(iterator) != frame.locations().cend()) {
11198
stream << "\n";
11299
}
@@ -162,7 +149,7 @@ auto sourcemeta::jsonschema::inspect(const sourcemeta::core::Options &options)
162149
const auto dialect{default_dialect(options, configuration)};
163150

164151
sourcemeta::core::SchemaFrame frame{
165-
sourcemeta::core::SchemaFrame::Mode::Instances};
152+
sourcemeta::core::SchemaFrame::Mode::References};
166153

167154
try {
168155
const auto &custom_resolver{

test/inspect/pass.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ cat << 'EOF' > "$TMP/expected.txt"
3333
Dialect : https://json-schema.org/draft/2020-12/schema
3434
Base Dialect : https://json-schema.org/draft/2020-12/schema
3535
Parent : <NONE>
36-
Instance Location :
3736
3837
(POINTER) URI: https://example.com#/$defs
3938
Type : Static
@@ -56,7 +55,6 @@ cat << 'EOF' > "$TMP/expected.txt"
5655
Dialect : https://json-schema.org/draft/2020-12/schema
5756
Base Dialect : https://json-schema.org/draft/2020-12/schema
5857
Parent :
59-
Instance Location :
6058
6159
(POINTER) URI: https://example.com#/$defs/string/type
6260
Type : Static

test/inspect/pass_custom_extension_json.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ cat << 'EOF' > "$TMP/expected.txt"
2828
Dialect : https://json-schema.org/draft/2020-12/schema
2929
Base Dialect : https://json-schema.org/draft/2020-12/schema
3030
Parent : <NONE>
31-
Instance Location :
3231
3332
(POINTER) URI: https://example.com#/$id
3433
Type : Static

test/inspect/pass_custom_extension_yaml.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ cat << 'EOF' > "$TMP/expected.txt"
2626
Dialect : https://json-schema.org/draft/2020-12/schema
2727
Base Dialect : https://json-schema.org/draft/2020-12/schema
2828
Parent : <NONE>
29-
Instance Location :
3029
3130
(POINTER) URI: https://example.com#/$id
3231
Type : Static

test/inspect/pass_default_dialect.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ cat << 'EOF' > "$TMP/expected.txt"
3131
Dialect : https://json-schema.org/draft/2020-12/schema
3232
Base Dialect : https://json-schema.org/draft/2020-12/schema
3333
Parent : <NONE>
34-
Instance Location :
3534
3635
(POINTER) URI: https://example.com#/$defs
3736
Type : Static
@@ -54,7 +53,6 @@ cat << 'EOF' > "$TMP/expected.txt"
5453
Dialect : https://json-schema.org/draft/2020-12/schema
5554
Base Dialect : https://json-schema.org/draft/2020-12/schema
5655
Parent :
57-
Instance Location :
5856
5957
(POINTER) URI: https://example.com#/$defs/string/type
6058
Type : Static

test/inspect/pass_default_dialect_config.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ cat << 'EOF' > "$TMP/expected.txt"
3636
Dialect : https://json-schema.org/draft/2020-12/schema
3737
Base Dialect : https://json-schema.org/draft/2020-12/schema
3838
Parent : <NONE>
39-
Instance Location :
4039
4140
(POINTER) URI: https://example.com#/$defs
4241
Type : Static
@@ -59,7 +58,6 @@ cat << 'EOF' > "$TMP/expected.txt"
5958
Dialect : https://json-schema.org/draft/2020-12/schema
6059
Base Dialect : https://json-schema.org/draft/2020-12/schema
6160
Parent :
62-
Instance Location :
6361
6462
(POINTER) URI: https://example.com#/$defs/string/type
6563
Type : Static

test/inspect/pass_default_dialect_config_relative.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ cat << 'EOF' > "$TMP/expected.txt"
3838
Dialect : https://json-schema.org/draft/2020-12/schema
3939
Base Dialect : https://json-schema.org/draft/2020-12/schema
4040
Parent : <NONE>
41-
Instance Location :
4241
4342
(POINTER) URI: https://example.com#/$defs
4443
Type : Static
@@ -61,7 +60,6 @@ cat << 'EOF' > "$TMP/expected.txt"
6160
Dialect : https://json-schema.org/draft/2020-12/schema
6261
Base Dialect : https://json-schema.org/draft/2020-12/schema
6362
Parent :
64-
Instance Location :
6563
6664
(POINTER) URI: https://example.com#/$defs/string/type
6765
Type : Static

test/inspect/pass_default_dialect_option_config.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ cat << 'EOF' > "$TMP/expected.txt"
3737
Dialect : https://json-schema.org/draft/2020-12/schema
3838
Base Dialect : https://json-schema.org/draft/2020-12/schema
3939
Parent : <NONE>
40-
Instance Location :
4140
4241
(POINTER) URI: https://example.com#/$defs
4342
Type : Static
@@ -60,7 +59,6 @@ cat << 'EOF' > "$TMP/expected.txt"
6059
Dialect : https://json-schema.org/draft/2020-12/schema
6160
Base Dialect : https://json-schema.org/draft/2020-12/schema
6261
Parent :
63-
Instance Location :
6462
6563
(POINTER) URI: https://example.com#/$defs/string/type
6664
Type : Static

test/inspect/pass_json_output.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,7 @@ cat << 'EOF' > "$TMP/expected_json.txt"
146146
"base": "https://json-schema.org/draft/2020-12/schema",
147147
"fragment": null
148148
}
149-
],
150-
"instances": {
151-
"": [ "" ],
152-
"/$defs/string": [ "" ]
153-
}
149+
]
154150
}
155151
EOF
156152

0 commit comments

Comments
 (0)