Skip to content

Commit 57db9d2

Browse files
Exclude RapidJSON from build
Migrating to boost::json Relates-To: OCMAM-447 Signed-off-by: Rustam Gamidov <ext-rustam.gamidov@here.com>
1 parent abd2351 commit 57db9d2

File tree

10 files changed

+5
-95
lines changed

10 files changed

+5
-95
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ The table below lists the dependencies of the Data SDK.
6464
| Boost (headers only) | 1.82.0 |
6565
| LevelDB | 1.21 |
6666
| Snappy | 1.1.7 |
67-
| RapidJSON | latest |
6867
| Zlib | 1.3.1 |
6968

7069
### Linux dependencies

docs/get-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ cmake --build . --target install
7171

7272
<a href="https://cmake.org/download/" target="_blank">CMake</a> is the main build system. The minimal required version of CMake is 3.9.
7373

74-
CMake downloads <a href="https://github.com/google/leveldb" target="_blank">LevelDB</a>, <a href="https://github.com/google/snappy" target="_blank">Snappy</a>, <a href="https://github.com/Tencent/rapidjson" target="_blank">RapidJSON</a>, and <a href="https://www.boost.org/" target="_blank">Boost</a>. To disable downloading, set `OLP_SDK_BUILD_EXTERNAL_DEPS` to `OFF`. For details on CMake flags, see the [related](#cmake-flags) section.
74+
CMake downloads <a href="https://github.com/google/leveldb" target="_blank">LevelDB</a>, <a href="https://github.com/google/snappy" target="_blank">Snappy</a>, and <a href="https://www.boost.org/" target="_blank">Boost</a>. To disable downloading, set `OLP_SDK_BUILD_EXTERNAL_DEPS` to `OFF`. For details on CMake flags, see the [related](#cmake-flags) section.
7575

7676
**To build the Data SDK:**
7777

docs/work-with-data-apis.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The example below demonstrates how to use the `olp::client::OlpClient` class fro
5959
}
6060
```
6161

62-
5. If the check passed and the status of the received `olp::client::HttpResponse` is `olp::http::HttpStatusCode::OK` (that is 200 OK), extract the encoded JSON from the response and parse it using RapidJSON or any other JSON parsing library.
62+
5. If the check passed and the status of the received `olp::client::HttpResponse` is `olp::http::HttpStatusCode::OK` (that is 200 OK), extract the encoded JSON from the response and parse it using JSON parsing library.
6363

6464
```cpp
6565
std::string response_json;

external/CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ set(OLP_SDK_CPP_SNAPPY_TAG "1.1.7")
4848
set(OLP_SDK_CPP_LEVELDB_URL "https://github.com/google/leveldb.git")
4949
set(OLP_SDK_CPP_LEVELDB_TAG "1.21")
5050

51-
set(OLP_SDK_CPP_RAPIDJSON_URL "https://github.com/Tencent/rapidjson.git")
52-
# Next commit after that breaks our build
53-
set(OLP_SDK_CPP_RAPIDJSON_TAG "d621dc9e9c77f81e5c8a35b8dcc16dcd63351321")
54-
5551
set(OLP_SDK_CPP_BOOST_URL "https://github.com/boostorg/boost.git")
5652
set(OLP_SDK_CPP_BOOST_TAG "boost-1.82.0")
5753

@@ -73,11 +69,6 @@ if(NOT TARGET GTest AND NOT GTest_FOUND)
7369
add_subdirectory(googletest)
7470
endif()
7571

76-
find_package(RapidJSON 1.1.0 QUIET)
77-
if(NOT TARGET RapidJSON AND NOT RapidJSON_FOUND)
78-
add_subdirectory(rapidjson)
79-
endif()
80-
8172
if(OLP_SDK_ENABLE_DEFAULT_CACHE)
8273
find_package(leveldb QUIET)
8374
if(NOT TARGET leveldb AND NOT leveldb_FOUND)

external/rapidjson/CMakeLists.txt

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

external/rapidjson/CMakeLists.txt.rapidjson.in

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

olp-cpp-sdk-dataservice-read/src/generated/parser/CatalogParser.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ void from_json(const boost::json::value& value, model::Schema& x) {
6363
}
6464

6565
void from_json(const boost::json::value& value, model::StreamProperties& x) {
66-
// Parsing these as double even though OepnAPI sepcs says int64 because
67-
// Backend returns the value in decimal format (e.g. 1.0) and this triggers an
68-
// assert in RapidJSON when parsing.
6966
x.SetDataInThroughputMbps(
7067
static_cast<int64_t>(parse<double>(value, "dataInThroughputMbps")));
7168
x.SetDataOutThroughputMbps(

olp-cpp-sdk-dataservice-read/src/generated/serializer/ByteVectorBuffer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2024 HERE Europe B.V.
2+
* Copyright (C) 2024-2026 HERE Europe B.V.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -55,7 +55,6 @@ class ByteVectorBuffer {
5555
Buffer GetBuffer() { return buffer_; }
5656

5757
private:
58-
// Using the same value as rapidjson
5958
static constexpr auto kDefaultCapacity = 256u;
6059
Buffer buffer_;
6160
};

olp-cpp-sdk-dataservice-write/src/generated/parser/CatalogParser.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ void from_json(const boost::json::value& value, model::Schema& x) {
6363
}
6464

6565
void from_json(const boost::json::value& value, model::StreamProperties& x) {
66-
// Parsing these as double even though OepnAPI sepcs says int64 because
67-
// Backend returns the value in decimal format (e.g. 1.0) and this triggers an
68-
// assert in RapidJSON when parsing.
6966
x.SetDataInThroughputMbps(
7067
static_cast<int64_t>(parse<double>(value, "dataInThroughputMbps")));
7168
x.SetDataOutThroughputMbps(

olp-cpp-sdk-dataservice-write/tests/ParserTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ TEST(ParserTest, Catalog) {
333333

334334
// TODO Test specfically for handling of OLP Backend bug:
335335
// Parse dataOutThroughputMbps, dataInThroughputMbps as double even though
336-
// OepnAPI sepcs says int64 because OLP Backend returns the value in decimal
337-
// format (e.g. 1.0) and this triggers an assert in RapidJSON when parsing.
336+
// OpenAPI sepcs says int64 because OLP Backend returns the value in decimal
337+
// format (e.g. 1.0).
338338
TEST(ParserTest, CatalogCrash) {
339339
std::string json_input =
340340
"{\"id\":\"olp-cpp-sdk-ingestion-test-catalog\",\"hrn\":\"hrn:here:data::"

0 commit comments

Comments
 (0)