Comprehensive client-side validation of flow json definitions#374
Merged
Conversation
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.
Member
Author
🧪 Details on Ubuntu 24.04.4 LTSfrom retest v1.1.0 on .NET 10.0.5 with 💜 by @devlooped |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
.github/plans/jsonflow.md.FlowJsonValidationTestsfor data-driven validation of Flow JSON, leveraging generated valid/invalid flows, and ensuring error codes are correctly surfaced.FlowJsonValidatorTestsin favor of the new data-driven approach.Dependency and Package Updates:
Microsoft.Extensions.*packages to version10.0.5for improved stability and compatibility insrc/Console/Console.csprojandsrc/SampleApp/SampleFunctions/SampleFunctions.csproj. [1] [2]Microsoft.CodeAnalysis.CSharpto version5.3.0and enabled extended analyzer rules insrc/CodeAnalysis/CodeAnalysis.csprojfor enhanced code analysis. [1] [2]Microsoft.Extensions.Http.ResilienceandMicrosoft.Extensions.Caching.Hybrid, to clean up project files. [1] [2]Codebase Cleanup:
src/Tests/FlowTests.csto streamline dependencies.