diff --git a/src/v/pandaproxy/schema_registry/json.cc b/src/v/pandaproxy/schema_registry/json.cc index e70c6cc2358c..e038045214c7 100644 --- a/src/v/pandaproxy/schema_registry/json.cc +++ b/src/v/pandaproxy/schema_registry/json.cc @@ -298,25 +298,25 @@ struct context { }; template -const jsoncons::jsonschema::json_schema& get_metaschema() { +const jsoncons::jsonschema::json_schema& get_metaschema() { static const auto meteschema_doc = [] { auto metaschema = [] { switch (Dialect) { case json_schema_dialect::draft4: return jsoncons::jsonschema::draft4::schema_draft4< - jsoncons::json>::get_schema(); + jsoncons::ojson>::get_schema(); case json_schema_dialect::draft6: return jsoncons::jsonschema::draft6::schema_draft6< - jsoncons::json>::get_schema(); + jsoncons::ojson>::get_schema(); case json_schema_dialect::draft7: return jsoncons::jsonschema::draft7::schema_draft7< - jsoncons::json>::get_schema(); + jsoncons::ojson>::get_schema(); case json_schema_dialect::draft201909: return jsoncons::jsonschema::draft201909::schema_draft201909< - jsoncons::json>::get_schema(); + jsoncons::ojson>::get_schema(); case json_schema_dialect::draft202012: return jsoncons::jsonschema::draft202012::schema_draft202012< - jsoncons::json>::get_schema(); + jsoncons::ojson>::get_schema(); } }(); @@ -329,7 +329,7 @@ const jsoncons::jsonschema::json_schema& get_metaschema() { } result validate_json_schema( - json_schema_dialect dialect, const jsoncons::json& schema) { + json_schema_dialect dialect, const jsoncons::ojson& schema) { // validation pre-step: get metaschema for json draft const auto& metaschema_doc = [=]() -> const auto& { using enum json_schema_dialect; @@ -367,7 +367,7 @@ result validate_json_schema( } result -try_validate_json_schema(const jsoncons::json& schema) { +try_validate_json_schema(const jsoncons::ojson& schema) { using enum json_schema_dialect; // no explicit $schema: try to validate from newest to oldest draft @@ -392,13 +392,13 @@ try_validate_json_schema(const jsoncons::json& schema) { // forward declaration id_to_schema_pointer collect_bundled_schema_and_fix_refs( - jsoncons::json& doc, json_schema_dialect dialect); + jsoncons::ojson& doc, json_schema_dialect dialect); result parse_json(iobuf buf) { // parse string in json document, check it's a valid json iobuf_istream is{buf.share(0, buf.size_bytes())}; - auto decoder = jsoncons::json_decoder{}; + auto decoder = jsoncons::json_decoder{}; auto reader = jsoncons::basic_json_reader(is.istream(), decoder); auto ec = std::error_code{}; reader.read(ec); @@ -2193,7 +2193,7 @@ void collect_bundled_schemas_and_fix_refs( id_to_schema_pointer& bundled_schemas, jsoncons::uri base_uri, jsoncons::jsonpointer::json_pointer this_obj_ptr, - jsoncons::json& this_obj, + jsoncons::ojson& this_obj, json_schema_dialect dialect) { // scan the json schema object for bundled schema. // A bundled schema is defined as a schema with `"$id" : a_base_uri`. @@ -2309,7 +2309,7 @@ void collect_bundled_schemas_and_fix_refs( } id_to_schema_pointer collect_bundled_schema_and_fix_refs( - jsoncons::json& doc, json_schema_dialect dialect) { + jsoncons::ojson& doc, json_schema_dialect dialect) { // entry point to collect all bundled schemas auto bundled_schemas = id_to_schema_pointer{}; if (doc.is_bool()) { diff --git a/src/v/pandaproxy/schema_registry/test/test_json_schema.cc b/src/v/pandaproxy/schema_registry/test/test_json_schema.cc index 47ebd922433e..f8011439b703 100644 --- a/src/v/pandaproxy/schema_registry/test/test_json_schema.cc +++ b/src/v/pandaproxy/schema_registry/test/test_json_schema.cc @@ -115,7 +115,7 @@ static const auto error_test_cases = std::to_array({ })", pps::error_info{ pps::error_code::schema_invalid, - R"(Invalid json schema: '{"$schema":"http://json-schema.org/draft-06/schema#","exclusiveMinimum":false,"minimum":0,"type":"number"}'. Error: '/exclusiveMinimum: Expected number, found boolean')"}}, + R"(Invalid json schema: '{"$schema":"http://json-schema.org/draft-06/schema#","type":"number","minimum":0,"exclusiveMinimum":false}'. Error: '/exclusiveMinimum: Expected number, found boolean')"}}, }); SEASTAR_THREAD_TEST_CASE(test_make_invalid_json_schema) { for (const auto& data : error_test_cases) {