Skip to content

Commit 58e2e69

Browse files
committed
Upgrade JSON Toolkit and AlterSchema
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent b25d543 commit 58e2e69

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+336
-8881
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
CXX: ${{ matrix.platform.cxx }}
6767
steps:
6868
- name: Install ClangFormat
69-
run: pip install clang-format==19.1.0
69+
run: pipx install clang-format==19.1.0
7070

7171
- uses: actions/checkout@v3
7272
- name: Install dependencies (macOS)

DEPENDENCIES

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
vendorpull https://github.com/sourcemeta/vendorpull 70342aaf458e6cb80baeb5b718901075fc42ede6
2-
jsontoolkit https://github.com/sourcemeta/jsontoolkit 9abbaee71e9e00e95632858d29c7ebe5c2a723b0
3-
alterschema https://github.com/sourcemeta/alterschema 358df64771979da64e043a416cf340d83a5382ca
2+
jsontoolkit https://github.com/sourcemeta/jsontoolkit 9685d29e2e633d71319c64b1ab2fbceab865dbf3
3+
alterschema https://github.com/sourcemeta/alterschema f81f1bb82e08365a2e892f0b5992f6d01213127b
44
googletest https://github.com/google/googletest 987e225614755fec7253aa95bf959c09e0d380d7
55
bootstrap https://github.com/twbs/bootstrap 1a6fdfae6be09b09eaced8f0e442ca6f7680a61e
66
noa https://github.com/sourcemeta/noa 517e88aef5981b88ac6bb8caff15d17dffcb4320

src/compiler/encoding.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,26 @@
44
#include <sourcemeta/jsontoolkit/json.h>
55
#include <sourcemeta/jsontoolkit/jsonschema.h>
66

7-
#include <future> // std::future
8-
97
namespace sourcemeta::jsonbinpack {
108

119
constexpr auto ENCODING_V1{"tag:sourcemeta.com,2024:jsonbinpack/encoding/v1"};
1210

1311
inline auto
1412
make_resolver(const sourcemeta::jsontoolkit::SchemaResolver &fallback) -> auto {
1513
return [&fallback](std::string_view identifier)
16-
-> std::future<std::optional<sourcemeta::jsontoolkit::JSON>> {
17-
std::promise<std::optional<sourcemeta::jsontoolkit::JSON>> promise;
14+
-> std::optional<sourcemeta::jsontoolkit::JSON> {
1815
if (identifier == ENCODING_V1) {
19-
promise.set_value(sourcemeta::jsontoolkit::parse(R"JSON({
16+
return sourcemeta::jsontoolkit::parse(R"JSON({
2017
"$id": "tag:sourcemeta.com,2024:jsonbinpack/encoding/v1",
2118
"$schema": "https://json-schema.org/draft/2020-12/schema",
2219
"$vocabulary": {
2320
"https://json-schema.org/draft/2020-12/vocab/core": true,
2421
"tag:sourcemeta.com,2024:jsonbinpack/encoding/v1": true
2522
}
26-
})JSON"));
23+
})JSON");
2724
} else {
28-
promise.set_value(fallback(identifier).get());
25+
return fallback(identifier);
2926
}
30-
31-
return promise.get_future();
3227
};
3328
}
3429

test/compiler/canonicalizer_test.cc

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,19 @@
44
#include <sourcemeta/jsontoolkit/json.h>
55
#include <sourcemeta/jsontoolkit/jsonschema.h>
66

7-
#include <future> // std::promise, std::future
87
#include <optional> // std::optional
98
#include <string> // std::string
109

1110
static auto test_resolver(std::string_view identifier)
12-
-> std::future<std::optional<sourcemeta::jsontoolkit::JSON>> {
13-
std::promise<std::optional<sourcemeta::jsontoolkit::JSON>> promise;
11+
-> std::optional<sourcemeta::jsontoolkit::JSON> {
1412
if (identifier == "https://jsonbinpack.sourcemeta.com/draft/unknown") {
15-
promise.set_value(sourcemeta::jsontoolkit::parse(R"JSON({
13+
return sourcemeta::jsontoolkit::parse(R"JSON({
1614
"$schema": "https://jsonbinpack.sourcemeta.com/draft/unknown",
1715
"$id": "https://jsonbinpack.sourcemeta.com/draft/unknown"
18-
})JSON"));
16+
})JSON");
1917
} else {
20-
promise.set_value(
21-
sourcemeta::jsontoolkit::official_resolver(identifier).get());
18+
return sourcemeta::jsontoolkit::official_resolver(identifier);
2219
}
23-
24-
return promise.get_future();
2520
}
2621

2722
TEST(JSONBinPack_Canonicalizer, unsupported_draft) {

vendor/alterschema/src/engine/rule.cc

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/jsontoolkit/CMakeLists.txt

Lines changed: 5 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/jsontoolkit/cmake/FindGoogleBenchmark.cmake

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/jsontoolkit/cmake/FindUriParser.cmake

Lines changed: 62 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/jsontoolkit/config.cmake.in

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/jsontoolkit/src/evaluator/CMakeLists.txt

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)