You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celix.apache.org by "PengZheng (via GitHub)" <gi...@apache.org> on 2026/08/10 05:38:28 UTC
[PR] Add JSON Schema validation, JSON Pointer and JSON Patch support to jansson_ext (celix)
PengZheng opened a new pull request, #842:
URL: https://github.com/apache/celix/pull/842
## Summary
This PR adds **JSON Schema (draft-07) validation**, **JSON Pointer**, and **JSON Patch** support to the new `jansson_ext` library, along with the supporting infrastructure needed to make it production-ready.
### New capabilities
- **JSON Schema validation** (`celix_jansson_schema.h`): draft-07 keyword support, `$ref` resolution including remote references, recursion depth guard for circular references, abort-on-first-error mode, and a full instance-path reporting mechanism.
- **JSON Pointer** (`celix_jansson_pointer.h`): parse/evaluate pointers with buffer-reuse and automatic cleanup support.
- **JSON Patch** (`celix_json_patch.h`): apply/validate patch documents, with self-reference and null-value guards.
- **URI validation** (`celix_jansson_uri`): `uri` format validation with array-index and malformed-pointer checks, IPv6 zone-id rejection, and automatic cleanup of URI resources.
- **String format checkers**: email (Ragel-generated SMTP state machine, corrupted tables fixed), time, IPv4/IPv6 validation.
- **String hash maps**: `properties`/`dependencies` handling refactored from hash tables to string hash maps for better memory management.
### Robustness & hardening
- Multiple hardening passes fixing unhandled allocation failures (OOM) throughout schema validation, JSON pointer operations, URI handling, and patch operations — with `error-injection` (EI) tests covering the OOM paths (`stdio_ei` vsnprintf support added).
- Fixes for leaks (double-free, path string management) found during coverage analysis.
### Tests & tooling
- ~9,000 lines of new unit tests, including the upstream JSON-Schema-Test-Suite draft-07 corpus.
- C++ compatibility for `celix_util.h` with unit tests for string buffer functions.
- Conan `test_package` support for `jansson_ext`.
- Coverage build fix: test execution enabled and `lcov` `--ignore-errors` flag removed.
- `rat-excludes.txt` updated for the vendored JSON-Schema-Test-Suite corpus.
### Files
127 files changed, ~27.4k insertions. The bulk is `libs/jansson_ext/` (new library sources, headers, examples, and tests).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@celix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add JSON Schema validation, JSON Pointer and JSON Patch support to jansson_ext (celix)
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #842:
URL: https://github.com/apache/celix/pull/842#issuecomment-5237092070
## [Codecov](https://app.codecov.io/gh/apache/celix/pull/842?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 92.43%. Comparing base ([`d4b2ec3`](https://app.codecov.io/gh/apache/celix/commit/d4b2ec368985675932fa159592b7808b9df69157?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`9e8f1c7`](https://app.codecov.io/gh/apache/celix/commit/9e8f1c7f5a21b90004a0d2ceb190d7c26ec6d9ab?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #842 +/- ##
==========================================
+ Coverage 91.62% 92.43% +0.80%
==========================================
Files 235 246 +11
Lines 28787 31849 +3062
==========================================
+ Hits 26377 29439 +3062
Misses 2410 2410
```
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/celix/pull/842?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@celix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add JSON Schema validation, JSON Pointer, JSON Patch and JSON Merge Patch support to jansson_ext (celix)
Posted by "pnoltes (via GitHub)" <gi...@apache.org>.
pnoltes commented on PR #842:
URL: https://github.com/apache/celix/pull/842#issuecomment-5285084472
Very interesting. I did a quick look and this looks like a nice addition. I do need some time to review this correctly, but will start planning that.
BTW, I was also working on JSONPath and extending array list and properties so that a more complete JSON support is possible (NULL value, mixed array support, nested properties). When this has been reviewed and merged, I will see if the NULL value, mixed array support and nested properties is still needed.
In this branch I was working on, filter also has some support for JSONPath usage; But I was not yet sure too keep that (possible high performance impact on filter evaluation and therefore service lookup).
https://github.com/apache/celix/compare/master...pnoltes:celix:feature/json-props-update-plan
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@celix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org