-
Notifications
You must be signed in to change notification settings - Fork 1
Memory #1
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
Memory #1
Conversation
Update subproject commit hash
***Update subproject commit hash in extern/utils
…in switch statement
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 ☂️ |
There was a problem hiding this 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" | |||
Copilot
AI
Nov 15, 2025
There was a problem hiding this comment.
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.
| #include "logging.hpp" | |
| #include "logging.h" |
| std::vector<json> vals; | ||
| is.get(); | ||
| json vals(json_type::array); | ||
| is >> std::ws; |
Copilot
AI
Nov 15, 2025
There was a problem hiding this comment.
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.
| assert(json::validate(value11, schema11, schemaRefs11)); | ||
| } | ||
|
|
||
| int main() |
Copilot
AI
Nov 15, 2025
There was a problem hiding this comment.
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.
| int main() | |
| int main(int argc, char *argv[]) |
No description provided.