Skip to content

Commit ee9bf11

Browse files
committed
Remove json_pointer::to_uri_fragment
1 parent 7a1b4a9 commit ee9bf11

File tree

7 files changed

+47
-259
lines changed

7 files changed

+47
-259
lines changed

doc/ref/jsonpointer/basic_json_pointer.md

-4
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@ Checks if the pointer is empty
8686
string_type to_string() const
8787
Returns a JSON Pointer represented as a string value, escaping any `/` or `~` characters.
8888
89-
string_type to_uri_fragment() const
90-
Returns a string representing the JSON Pointer as a URI fragment identifier,
91-
escaping any `/` or `~` characters.
92-
9389
9490
#### Static member functions
9591

include/jsoncons_ext/jsonpointer/jsonpointer.hpp

-28
Original file line numberDiff line numberDiff line change
@@ -367,34 +367,6 @@ namespace jsoncons { namespace jsonpointer {
367367
return buffer;
368368
}
369369

370-
string_type to_uri_fragment() const
371-
{
372-
string_type buffer{'#'};
373-
for (const auto& token : tokens_)
374-
{
375-
buffer.push_back('/');
376-
string_type s = escape_uri_string(token);
377-
for (auto c : s)
378-
{
379-
switch (c)
380-
{
381-
case '~':
382-
buffer.push_back('~');
383-
buffer.push_back('0');
384-
break;
385-
case '/':
386-
buffer.push_back('~');
387-
buffer.push_back('1');
388-
break;
389-
default:
390-
buffer.push_back(c);
391-
break;
392-
}
393-
}
394-
}
395-
return buffer;
396-
}
397-
398370
// Iterators
399371
iterator begin() const
400372
{

include/jsoncons_ext/jsonschema/common/format_validator.hpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ namespace jsonschema {
848848
reporter.error(validation_output("date",
849849
eval_path,
850850
schema_path,
851-
instance_location.to_uri_fragment(),
851+
instance_location.to_string(),
852852
"\"" + value + "\" is not a RFC 3339 date string"));
853853
}
854854
}
@@ -864,7 +864,7 @@ namespace jsonschema {
864864
reporter.error(validation_output("time",
865865
eval_path,
866866
schema_path,
867-
instance_location.to_uri_fragment(),
867+
instance_location.to_string(),
868868
"\"" + value + "\" is not a RFC 3339 time string"));
869869
}
870870
}
@@ -880,7 +880,7 @@ namespace jsonschema {
880880
reporter.error(validation_output("date-time",
881881
eval_path,
882882
schema_path,
883-
instance_location.to_uri_fragment(),
883+
instance_location.to_string(),
884884
"\"" + value + "\" is not a RFC 3339 date-time string"));
885885
}
886886
}
@@ -896,7 +896,7 @@ namespace jsonschema {
896896
reporter.error(validation_output("email",
897897
eval_path,
898898
schema_path,
899-
instance_location.to_uri_fragment(),
899+
instance_location.to_string(),
900900
"\"" + value + "\" is not a valid email address as defined by RFC 5322"));
901901
}
902902
}
@@ -912,7 +912,7 @@ namespace jsonschema {
912912
reporter.error(validation_output("hostname",
913913
eval_path,
914914
schema_path,
915-
instance_location.to_uri_fragment(),
915+
instance_location.to_string(),
916916
"\"" + value + "\" is not a valid hostname as defined by RFC 3986 Appendix A"));
917917
}
918918
}
@@ -928,7 +928,7 @@ namespace jsonschema {
928928
reporter.error(validation_output("ipv4",
929929
eval_path,
930930
schema_path,
931-
instance_location.to_uri_fragment(),
931+
instance_location.to_string(),
932932
"\"" + value + "\" is not a valid IPv4 address as defined by RFC 2673"));
933933
}
934934
}
@@ -944,7 +944,7 @@ namespace jsonschema {
944944
reporter.error(validation_output("ipv6",
945945
eval_path,
946946
schema_path,
947-
instance_location.to_uri_fragment(),
947+
instance_location.to_string(),
948948
"\"" + value + "\" is not a valid IPv6 address as defined by RFC 2373"));
949949
}
950950
}
@@ -965,7 +965,7 @@ namespace jsonschema {
965965
reporter.error(validation_output("pattern",
966966
eval_path,
967967
schema_path,
968-
instance_location.to_uri_fragment(),
968+
instance_location.to_string(),
969969
"\"" + value + "\" is not a valid ECMAScript regular expression. " + e.what()));
970970
}
971971
#endif

include/jsoncons_ext/jsonschema/common/keyword_validator.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ namespace jsonschema {
221221
reporter.error(validation_output("false",
222222
eval_context.eval_path(),
223223
this->schema_path(),
224-
instance_location.to_uri_fragment(),
224+
instance_location.to_string(),
225225
"False schema always fails"));
226226
}
227227
}
@@ -272,7 +272,7 @@ namespace jsonschema {
272272
error_reporter& reporter,
273273
Json& patch) const final
274274
{
275-
//std::cout << "object_schema_validator: " << eval_context.eval_path().to_uri_fragment() << " " << instance << "\n\n";
275+
//std::cout << "object_schema_validator: " << eval_context.eval_path().to_string() << " " << instance << "\n\n";
276276

277277
std::unordered_set<std::string> local_evaluated_properties;
278278

0 commit comments

Comments
 (0)