Skip to content

Conversation

@riccardodebenedictis
Copy link
Contributor

No description provided.

Update subproject commit hash
***Update subproject commit hash in extern/utils
@codecov
Copy link

codecov bot commented Nov 15, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the JSON library implementation to use std::variant for internal value storage, improving type safety and memory efficiency. The changes modernize the codebase with C++17 features and add comprehensive validation functionality.

  • Replaces manual type tracking with std::variant-based storage
  • Adds JSON schema validation with support for standard JSON Schema features
  • Modernizes CMake configuration and CI/CD pipelines with enhanced testing

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
include/json.hpp Complete rewrite using std::variant for value storage, added validation API and comprehensive documentation
src/json.cpp Refactored parsing logic and added validation implementation
tests/test_json.cpp Added constructor, assignment, and validation test coverage; updated to use new API methods
tests/CMakeLists.txt Added sanitizer setup for test executable
CMakeLists.txt Simplified build configuration, removed export header generation
.github/workflows/cmake.yml Expanded CI matrix with separate jobs for sanitizers, memory checking, and coverage
README.md Added build status and coverage badges
src/jsonConfig.cmake.in Removed CMake package configuration file
extern/utils Updated submodule reference

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -1,8 +1,168 @@
#include "json.hpp"
#include "logging.h"
#include "logging.hpp"
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The header file has been changed from 'logging.h' to 'logging.hpp'. Ensure this change aligns with the actual header file name in the codebase. If 'logging.h' is the correct header, this change introduces a bug.

Suggested change
#include "logging.hpp"
#include "logging.h"

Copilot uses AI. Check for mistakes.
std::vector<json> vals;
is.get();
json vals(json_type::array);
is >> std::ws;
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing whitespace consumption after opening bracket. The line is >> std::ws; was added after is.get() for arrays but not for objects (line 125). This inconsistency could cause parsing issues when arrays have whitespace after the opening bracket.

Copilot uses AI. Check for mistakes.
assert(json::validate(value11, schema11, schemaRefs11));
}

int main()
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The function signature has been changed from int main(int, char **) to int main(). While this is valid, the original signature is more conventional for programs that might be extended to accept command-line arguments in the future.

Suggested change
int main()
int main(int argc, char *argv[])

Copilot uses AI. Check for mistakes.
@riccardodebenedictis riccardodebenedictis merged commit 8f69ce8 into main Nov 15, 2025
20 of 21 checks passed
@riccardodebenedictis riccardodebenedictis deleted the memory branch November 15, 2025 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants