Skip to content

Comprehensive client-side validation of flow json definitions#374

Merged
kzu merged 7 commits intomainfrom
dev/flowrules
Apr 2, 2026
Merged

Comprehensive client-side validation of flow json definitions#374
kzu merged 7 commits intomainfrom
dev/flowrules

Conversation

@kzu
Copy link
Copy Markdown
Member

@kzu kzu commented Apr 2, 2026

This pull request introduces a comprehensive Flow JSON validation feature for the WhatsApp .NET SDK, including a robust two-tier validation architecture (JSON Schema + programmatic rules), a new test data generator, and a complete suite of data-driven validation tests. It also updates and streamlines dependencies across several projects and refactors the test suite for clarity and maintainability.

Flow JSON Validation Feature Implementation:

  • Added a detailed implementation plan for Flow JSON validation, outlining a two-tier validation approach (JSON Schema + programmatic C# rules), test data generation, and integration steps in .github/plans/jsonflow.md.
  • Introduced FlowJsonValidationTests for data-driven validation of Flow JSON, leveraging generated valid/invalid flows, and ensuring error codes are correctly surfaced.
  • Removed the older, less comprehensive FlowJsonValidatorTests in favor of the new data-driven approach.

Dependency and Package Updates:

  • Upgraded several Microsoft.Extensions.* packages to version 10.0.5 for improved stability and compatibility in src/Console/Console.csproj and src/SampleApp/SampleFunctions/SampleFunctions.csproj. [1] [2]
  • Updated Microsoft.CodeAnalysis.CSharp to version 5.3.0 and enabled extended analyzer rules in src/CodeAnalysis/CodeAnalysis.csproj for enhanced code analysis. [1] [2]
  • Removed unused or redundant package references, such as Microsoft.Extensions.Http.Resilience and Microsoft.Extensions.Caching.Hybrid, to clean up project files. [1] [2]

Codebase Cleanup:

  • Removed unnecessary using directives in src/Tests/FlowTests.cs to streamline dependencies.

kzu added 7 commits April 2, 2026 15:44
This makes it far simpler for an agent to figure out what are the valid inputs for a JSON flow API payload too.
Removed `IWhatsAppFlowsClient` and its implementation, consolidating functionality into `IWhatsAppClient`. Updated `FlowJsonValidator` to use `JsonElement` instead of `JsonNode` for improved performance and compatibility. Removed `FlowJsonValidatorTests` and redesigned validation handling.

Refactored `FlowTests` to remove dependency on `WhatsAppFlowsClient`. Updated extension methods to reflect the removal of `IWhatsAppFlowsClient`. Cleaned up redundant code and adjusted test methods accordingly.

Upgraded NuGet dependencies, including `Devlooped.JQ` and `JsonSchema.Net`. Removed outdated packages and streamlined project references.
@kzu kzu added the enhancement New feature or request label Apr 2, 2026
@kzu kzu enabled auto-merge (rebase) April 2, 2026 20:15
@kzu
Copy link
Copy Markdown
Member Author

kzu commented Apr 2, 2026

193 passed 193 passed 22 skipped

🧪 Details on Ubuntu 24.04.4 LTS

from retest v1.1.0 on .NET 10.0.5 with 💜 by @devlooped

@kzu kzu merged commit 4522306 into main Apr 2, 2026
4 checks passed
@kzu kzu deleted the dev/flowrules branch April 2, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant