Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Changelog

## [v1.2.0] - In Development

### Added
- Array indexing support in JSONPath (e.g., `array[0].property`)
- New comparison operators: `starts_with`, `ends_with`, and `contains`
- Comprehensive unit tests for all new features

### Changed
- Replaced JSON serialization with direct object navigation for path evaluation (50%+ performance improvement)
- Optimized expression parsing without regex dependency
- Fixed namespace inconsistency across library components
- Implemented thread-safe operator dictionary to prevent race conditions

### Performance
- Direct object navigation replacing JSON serialization for path evaluation (50%+ faster)
- Optimized expression parsing without regex
- Reduced memory allocations by 60%+

### Fixed
- Namespace inconsistency: Changed JsonPathPredicate to JSONPredicate in supporting files
- Thread safety in operator dictionary access

## [v1.0.0] - Initial Release
- Initial release of JSONPredicate library
- Core functionality with basic operators
- JSONPath-style property navigation
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
next-version: 1.1.0
next-version: 1.2.0
tag-prefix: '[vV]'
mode: ContinuousDeployment
branches:
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <img src="https://github.com/CodeShayk/JSONPredicate/blob/master/Images/ninja-icon-16.png" alt="ninja" style="width:30px;"/> JSONPredicate v1.1.0
# <img src="https://github.com/CodeShayk/JSONPredicate/blob/master/Images/ninja-icon-16.png" alt="ninja" style="width:30px;"/> JSONPredicate v1.2.0
[![NuGet version](https://badge.fury.io/nu/JSONPredicate.svg)](https://badge.fury.io/nu/JSONPredicate) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/CodeShayk/JSONPredicate/blob/master/LICENSE.md)
[![GitHub Release](https://img.shields.io/github/v/release/CodeShayk/JSONPredicate?logo=github&sort=semver)](https://github.com/CodeShayk/JSONPredicate/releases/latest)
[![master-build](https://github.com/CodeShayk/JSONPredicate/actions/workflows/Master-Build.yml/badge.svg)](https://github.com/CodeShayk/JSONPredicate/actions/workflows/Master-Build.yml)
Expand All @@ -18,7 +18,7 @@
- **Multiple Operators**: `eq` (equal), `in` (contains), `not` (not equal), `gt` (greater than), `gte` (greater than or equal), `lt` (less than), `lte` (less than or equal)
- **Logical Operators**: `and`, `or` with proper precedence handling
- **Array Handling**: Evaluate conditions on `arrays` and `collections`. Support array `indexing` (Available from v1.1.0)
- **String Operations**: `starts_with`, `ends_with`, `contains` (Available from v1.1.0)
- **String Operations**: `starts_with`, `ends_with`, `contains` (Available from v1.2.0)
- **Type Safety**: `Automatic` type conversion and validation
- **Complex Expressions**: `Parentheses` grouping and `nested` operations
- **Lightweight**: `Minimal` dependencies, `fast` evaluation
Expand All @@ -38,7 +38,7 @@ The expression syntax is ([JSONPath] [Comparison Operator] [Value]) [Logical Ope
#### ii. Supported Operators
- Comparison Operators - `eq`, `in`, `gt`, `gte`, `lt`, `lte` & `Not`
- Logical Operators - `and` & `or`
- String Operators - `starts_with`, `ends_with`, `contains` (Available from v1.1.0)
- String Operators - `starts_with`, `ends_with`, `contains` (Available from v1.2.0)
### Example
```
var customer = new {
Expand Down Expand Up @@ -66,13 +66,13 @@ bool result2 = JSONPredicate.Evaluate("client.address.postcode eq `e113et` and c
bool result3 = JSONPredicate.Evaluate("client.tags in [`vip`, `standard`]", customer);
bool
```
#### iv. String operators (Available from v1.1.0)
#### iv. String operators (Available from v1.2.0)
```
bool result4 = JSONPredicate.Evaluate("client.address.postcode starts_with `e11`", customer);
bool result5 = JSONPredicate.Evaluate("client.address.postcode ends_with `3et`", customer);
bool result6 = JSONPredicate.Evaluate("client.address.postcode contains `13`", customer);
```
#### v. Deep Array Indexing (Available from v1.1.0)
#### v. Deep Array Indexing (Available from v1.2.0)
```
bool result7 = JSONPredicate.Evaluate("client.tags[1] eq `premium`", customer);
```
Expand All @@ -86,7 +86,7 @@ This section provides the summary of planned releases with key details about eac
| Version | Release Date | Type | Key Improvements | Backward Compatible |
|---------|--------------|------|------------------|-------------------|
| v1.0.0 | August 2025 | Major | Initial release with core predicate evaluation | N/A |
| v1.1.0 | October 2025 | Minor | Namespace consistency, thread safety, 50%+ performance improvement, array indexing, new operators (`starts_with`, `ends_with`, `contains`) | Yes |
| v1.2.0 | October 2025 | Minor | Namespace consistency, thread safety, 50%+ performance improvement, array indexing, new operators (`starts_with`, `ends_with`, `contains`), comprehensive unit tests | Yes |
| v2.0.0 | TBC | Major | Comprehensive validation, performance benchmarking, thread safety verification, complete documentation | Mostly* |

*Note: v2.0.0 marked as "Mostly" backward compatible due to major internal changes that may affect some advanced usage patterns.
Expand Down
25 changes: 5 additions & 20 deletions Release_Roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Initial release of the JSONPredicate library. Provides core functionality for ev

---

### v1.1.0 - Combined Fix, Feature and Performance Release
### v1.2.0 - Combined Fix, Feature and Performance Release
**Release Type**: Minor (Backward Compatible)
**Release Date**: October 2025
**Focus**: Critical fixes, new functionality and performance improvements
Expand Down Expand Up @@ -148,24 +148,17 @@ Major feature and performance release with comprehensive validation. This releas

## Evolution Summary

### v1.0.0 → v1.1.0: Foundation, Stability, Performance and Features
### v1.0.0 → v1.2.0: Foundation, Stability, Performance and Features
- **Focus**: Internal consistency, thread safety, performance optimization and new functionality
- **Improvement**: Fixed critical namespace inconsistency
- **Improvement**: Made operator dictionary thread-safe
- **Improvement**: 50%+ performance improvement through direct object navigation
- **Improvement**: Expression parsing optimization removing regex dependency
- **Addition**: Array indexing support (e.g., `array[0].property`)
- **Addition**: New operators (`starts_with`, `ends_with`, `contains`)
- **Addition**: Comprehensive unit tests for all new features
- **Impact**: Better stability, reliability and performance with new features, all backward compatible

### v1.1.0 → v2.0.0: Validation and Production Readiness
- **Focus**: Comprehensive validation and release preparation
- **Achievement**: All features integrated and validated together
- **Achievement**: Performance improvements quantitatively verified
- **Achievement**: Thread safety comprehensively tested
- **Achievement**: Complete documentation and packaging
- **Impact**: Production-ready major release with all improvements validated

## Technical Improvements Summary

### Performance Improvements
Expand All @@ -188,21 +181,13 @@ Major feature and performance release with comprehensive validation. This releas

## Upgrade Path

### From v1.0.0 to v1.1.0
### From v1.0.0 to v1.2.0
- Drop-in replacement
- No code changes required for existing functionality
- Benefits: Thread safety, performance improvements, and new features available

### From v1.0.x to v2.0.0
- Drop-in replacement for basic usage
- Thorough testing recommended for advanced usage due to internal implementation changes
- Benefit: All improvements and comprehensive validation

## Key Metrics

| Version | Performance Improvement | Memory Improvement | New Features | Backward Compatible |
|---------|------------------------|-------------------|----------------|-------------------|
| v1.1.0 | 50-70% | 60%+ | Namespace consistency, thread safety, array indexing, 3 new operators | Yes |
| v2.0.0 | 50-70% (maintained) | 60%+ (maintained) | Complete validation, documentation | Mostly |

*Note: v2.0.0 marked as "Mostly" backward compatible due to major internal changes that may affect some advanced usage patterns.*
| v1.2.0 | 50-70% | 60%+ | Namespace consistency, thread safety, array indexing, 3 new operators, comprehensive unit tests | Yes |
2 changes: 1 addition & 1 deletion src/JSONPredicate/Expression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static (string Path, string Operator, string Value) Parse(string expressi
throw new ArgumentException($"Invalid expression format: {expression}");

// Define operators in order of length (longer first) to avoid partial matches
var operators = new[] { "gte", "lte", "not", "eq", "gt", "lt", "in" };
var operators = new[] { "gte", "lte", "not", "eq", "gt", "lt", "in", "starts_with", "ends_with", "contains" };

for (int i = 0; i < expr.Length; i++)
{
Expand Down
8 changes: 4 additions & 4 deletions src/JSONPredicate/JSONPredicate.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;netstandard2.0;netstandard2.1;net9.0</TargetFrameworks>
Expand All @@ -21,17 +21,17 @@
<PackageProjectUrl>https://github.com/CodeShayk/JSONPredicate/wiki</PackageProjectUrl>
<RepositoryUrl>https://github.com/CodeShayk/JSONPredicate</RepositoryUrl>
<PackageReleaseNotes>
v1.1.0 - Enhanced JSONPredicate library with significant improvements.
v1.2.0 - Enhanced JSONPredicate library with additional improvements.
- Array indexing support in JSONPath (e.g., `array[0].property`)
- New comparison operators: `starts_with`, `ends_with`, and `contains`
- Direct object navigation with 50%+ performance improvement
- Thread-safe operation in multi-threaded environments
- Optimized expression parsing without regex dependency.

For more details, visit the release page:
https://github.com/CodeShayk/JSONPredicate/releases/tag/v1.1.0
https://github.com/CodeShayk/JSONPredicate/releases/tag/v1.2.0
</PackageReleaseNotes>
<Version>1.1.0</Version>
<Version>1.2.0</Version>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<AssemblyName>JSONPredicate</AssemblyName>
</PropertyGroup>
Expand Down
Loading
Loading