Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade all dependencies and remove the compile command (no longer supported upstream) #208

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 6 additions & 6 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
vendorpull https://github.com/sourcemeta/vendorpull dea311b5bfb53b6926a4140267959ae334d3ecf4
noa https://github.com/sourcemeta/noa caad2e1ceedf9fd1a18686a6a6d1e2b9757ead75
jsontoolkit https://github.com/sourcemeta/jsontoolkit 7a398224cc2e76ea9ae8541a872b131c7c025267
hydra https://github.com/sourcemeta/hydra a4a74f3cabd32f2f829f449d67339dac33f9910e
alterschema https://github.com/sourcemeta/alterschema 92e370ce9c1f0582014b54d43e388ee012dfe13d
jsonbinpack https://github.com/sourcemeta/jsonbinpack d777179441d3c703e1fda1187742541aa26836b5
blaze https://github.com/sourcemeta/blaze 4990da88241847b561cf43efba2c0c7d2bfc9642
noa https://github.com/sourcemeta/noa 924f5cc8549af7f12227869dcbab4259029ac650
jsontoolkit https://github.com/sourcemeta/jsontoolkit 4b37450b287695fd0fa63f50c1fe6a43d2384c51
hydra https://github.com/sourcemeta/hydra c31b5b612beb3e6a870deb2581ae437fc5183f47
alterschema https://github.com/sourcemeta/alterschema 0fcd3b3b921bd47dc0867477619383f6519939fa
jsonbinpack https://github.com/sourcemeta/jsonbinpack ea02b415f266c7529be13b9e2b26bc8d74b5e4a8
blaze https://github.com/sourcemeta/blaze a906d6601bc5d7afd4ddb6cbf9f64326aeee1b0c
23 changes: 11 additions & 12 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ Version support

We aim to fully support _every_ version of JSON Schema and combinations between them.

| Dialect | Support |
|---------------------|------------------------------------------------------------------|
| JSON Schema 2020-12 | **Full** |
| JSON Schema 2019-09 | **Full** |
| JSON Schema Draft 7 | **Full** |
| JSON Schema Draft 6 | **Full** |
| JSON Schema Draft 4 | **Full** |
| JSON Schema Draft 3 | Partial (except `validate`, `test`, `metaschema`, and `compile`) |
| JSON Schema Draft 2 | Partial (except `validate`, `test`, `metaschema`, and `compile`) |
| JSON Schema Draft 1 | Partial (except `validate`, `test`, `metaschema`, and `compile`) |
| JSON Schema Draft 0 | Partial (except `validate`, `test`, `metaschema`, and `compile`) |
| Dialect | Support |
|---------------------|-------------------------------------------------------|
| JSON Schema 2020-12 | **Full** |
| JSON Schema 2019-09 | **Full** |
| JSON Schema Draft 7 | **Full** |
| JSON Schema Draft 6 | **Full** |
| JSON Schema Draft 4 | **Full** |
| JSON Schema Draft 3 | Partial (except `validate`, `test`, and `metaschema`) |
| JSON Schema Draft 2 | Partial (except `validate`, `test`, and `metaschema`) |
| JSON Schema Draft 1 | Partial (except `validate`, `test`, and `metaschema`) |
| JSON Schema Draft 0 | Partial (except `validate`, `test`, and `metaschema`) |

What our users are saying
-------------------------
Expand All @@ -63,7 +63,6 @@ documentation:
- [`jsonschema lint`](./docs/lint.markdown)
- [`jsonschema bundle`](./docs/bundle.markdown) (for inlining remote references in a schema)
- [`jsonschema frame`](./docs/frame.markdown) (for debugging references)
- [`jsonschema compile`](./docs/compile.markdown) (for internal debugging)
- [`jsonschema identify`](./docs/identify.markdown)
- [`jsonschema canonicalize`](./docs/canonicalize.markdown) (for static analysis)
- [`jsonschema encode`](./docs/encode.markdown) (for binary compression)
Expand Down
151 changes: 0 additions & 151 deletions docs/compile.markdown

This file was deleted.

1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ add_executable(jsonschema_cli
command_fmt.cc
command_frame.cc
command_bundle.cc
command_compile.cc
command_test.cc
command_lint.cc
command_metaschema.cc
Expand Down
1 change: 0 additions & 1 deletion src/command.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace sourcemeta::jsonschema::cli {
auto fmt(const std::span<const std::string> &arguments) -> int;
auto frame(const std::span<const std::string> &arguments) -> int;
auto bundle(const std::span<const std::string> &arguments) -> int;
auto compile(const std::span<const std::string> &arguments) -> int;
auto test(const std::span<const std::string> &arguments) -> int;
auto lint(const std::span<const std::string> &arguments) -> int;
auto validate(const std::span<const std::string> &arguments) -> int;
Expand Down
16 changes: 7 additions & 9 deletions src/command_bundle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,15 @@ auto sourcemeta::jsonschema::cli::bundle(

auto schema{sourcemeta::jsontoolkit::from_file(options.at("").front())};

sourcemeta::jsontoolkit::bundle(
schema, sourcemeta::jsontoolkit::default_schema_walker,
resolver(options, options.contains("h") || options.contains("http")));

if (options.contains("w") || options.contains("without-id")) {
log_verbose(options) << "Bundling without using identifiers\n";
sourcemeta::jsontoolkit::bundle(
schema, sourcemeta::jsontoolkit::default_schema_walker,
resolver(options, options.contains("h") || options.contains("http")),
sourcemeta::jsontoolkit::BundleOptions::WithoutIdentifiers);
} else {
sourcemeta::jsontoolkit::bundle(
log_verbose(options) << "Removing schema identifiers\n";
sourcemeta::jsontoolkit::unidentify(
schema, sourcemeta::jsontoolkit::default_schema_walker,
resolver(options, options.contains("h") || options.contains("http")),
sourcemeta::jsontoolkit::BundleOptions::Default);
resolver(options, options.contains("h") || options.contains("http")));
}

sourcemeta::jsontoolkit::prettify(
Expand Down
37 changes: 0 additions & 37 deletions src/command_compile.cc

This file was deleted.

38 changes: 22 additions & 16 deletions src/command_frame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@
#include "utils.h"

static auto
enum_to_string(const sourcemeta::jsontoolkit::ReferenceEntryType type)
enum_to_string(const sourcemeta::jsontoolkit::Frame::LocationType type)
-> std::string {
switch (type) {
case sourcemeta::jsontoolkit::ReferenceEntryType::Resource:
case sourcemeta::jsontoolkit::Frame::LocationType::Resource:
return "resource";
case sourcemeta::jsontoolkit::ReferenceEntryType::Anchor:
case sourcemeta::jsontoolkit::Frame::LocationType::Anchor:
return "anchor";
case sourcemeta::jsontoolkit::ReferenceEntryType::Pointer:
case sourcemeta::jsontoolkit::Frame::LocationType::Pointer:
return "pointer";
case sourcemeta::jsontoolkit::Frame::LocationType::Subschema:
return "subschema";
default:
return "unknown";
}
Expand All @@ -36,19 +38,17 @@ auto sourcemeta::jsonschema::cli::frame(
const sourcemeta::jsontoolkit::JSON schema{
sourcemeta::jsontoolkit::from_file(options.at("").front())};

sourcemeta::jsontoolkit::ReferenceFrame frame;
sourcemeta::jsontoolkit::ReferenceMap references;
sourcemeta::jsontoolkit::frame(schema, frame, references,
sourcemeta::jsontoolkit::default_schema_walker,
resolver(options));
sourcemeta::jsontoolkit::Frame frame;
frame.analyse(schema, sourcemeta::jsontoolkit::default_schema_walker,
resolver(options));

const auto output_json = options.contains("json") || options.contains("j");
if (output_json) {
auto output_json_object = sourcemeta::jsontoolkit::JSON::make_object();
auto frame_json = sourcemeta::jsontoolkit::JSON::make_object();
auto references_json = sourcemeta::jsontoolkit::JSON::make_object();

for (const auto &[key, entry] : frame) {
for (const auto &[key, entry] : frame.locations()) {
auto frame_entry = sourcemeta::jsontoolkit::JSON::make_object();
if (entry.root.has_value()) {
frame_entry.assign("root",
Expand All @@ -70,12 +70,14 @@ auto sourcemeta::jsonschema::cli::frame(
sourcemeta::jsontoolkit::JSON{reference_stream.str()});
frame_entry.assign("dialect",
sourcemeta::jsontoolkit::JSON{entry.dialect});
frame_entry.assign("baseDialect",
sourcemeta::jsontoolkit::JSON{entry.base_dialect});
frame_json.assign(key.second, sourcemeta::jsontoolkit::JSON{frame_entry});
}
output_json_object.assign("frames",
sourcemeta::jsontoolkit::JSON{frame_json});

for (const auto &[pointer, entry] : references) {
for (const auto &[pointer, entry] : frame.references()) {
auto ref_entry = sourcemeta::jsontoolkit::JSON::make_object();
ref_entry.assign(
"type",
Expand Down Expand Up @@ -109,17 +111,20 @@ auto sourcemeta::jsonschema::cli::frame(
sourcemeta::jsontoolkit::prettify(output_json_object, print_stream);
std::cout << print_stream.str() << std::endl;
} else {
for (const auto &[key, entry] : frame) {
for (const auto &[key, entry] : frame.locations()) {
switch (entry.type) {
case sourcemeta::jsontoolkit::ReferenceEntryType::Resource:
case sourcemeta::jsontoolkit::Frame::LocationType::Resource:
std::cout << "(LOCATION)";
break;
case sourcemeta::jsontoolkit::ReferenceEntryType::Anchor:
case sourcemeta::jsontoolkit::Frame::LocationType::Anchor:
std::cout << "(ANCHOR)";
break;
case sourcemeta::jsontoolkit::ReferenceEntryType::Pointer:
case sourcemeta::jsontoolkit::Frame::LocationType::Pointer:
std::cout << "(POINTER)";
break;
case sourcemeta::jsontoolkit::Frame::LocationType::Subschema:
std::cout << "(SUBSCHEMA)";
break;
default:
// We should never get here
assert(false);
Expand Down Expand Up @@ -154,9 +159,10 @@ auto sourcemeta::jsonschema::cli::frame(
sourcemeta::jsontoolkit::stringify(entry.relative_pointer, std::cout);
std::cout << "\n";
std::cout << " Dialect : " << entry.dialect << "\n";
std::cout << " Base Dialect : " << entry.base_dialect << "\n";
}

for (const auto &[pointer, entry] : references) {
for (const auto &[pointer, entry] : frame.references()) {
std::cout << "(REFERENCE) URI: ";
sourcemeta::jsontoolkit::stringify(pointer.second, std::cout);
std::cout << "\n";
Expand Down
Loading
Loading