Skip to content

feat: explainDecision + audit search filter parity#128

Merged
saurabhjain1592 merged 2 commits intomainfrom
feat/plugin-batch-1
Apr 18, 2026
Merged

feat: explainDecision + audit search filter parity#128
saurabhjain1592 merged 2 commits intomainfrom
feat/plugin-batch-1

Conversation

@saurabhjain1592
Copy link
Copy Markdown
Member

Summary

Java SDK half of Plugin Batch 1 (ADR-042 + ADR-043).

Companion to:

Added

  • AxonFlow.explainDecision(decisionId) + explainDecisionAsync
  • DecisionExplanation, ExplainPolicy, ExplainRule DTOs
  • AuditSearchRequest.Builder gains decisionId, policyName, overrideId

Version: 5.3.0 → 5.4.0

Tests

8 new JUnit tests via WireMock, all passing.

@saurabhjain1592 saurabhjain1592 added the enhancement New feature or request label Apr 17, 2026
@saurabhjain1592 saurabhjain1592 changed the title Plugin Batch 1: explainDecision + audit search filter parity feat: explainDecision + audit search filter parity Apr 17, 2026
Adds Java SDK half of ADR-043 + ADR-042.

New:
- DecisionExplanation, ExplainPolicy, ExplainRule DTOs in
  com.getaxonflow.sdk.types. Jackson @JsonIgnoreProperties(ignoreUnknown=
  true) for ADR-043 forward-compat with future platform fields.
- AxonFlow.explainDecision(decisionId) + explainDecisionAsync calling
  GET /api/v1/decisions/:id/explain. URL-encodes the decision ID.
  Rejects null/empty with IllegalArgumentException.
- AuditSearchRequest builder gains decisionId/policyName/overrideId;
  new JSON properties serialize only when set via @JsonInclude(NON_NULL).

Version: 5.3.0 -> 5.4.0 (pom.xml).

Tests (8 new, all passing via WireMock):
- explainDecision: null + empty rejection, full payload parse with URL
  assertion, forward-compat with unknown fields.
- searchAuditLogs: new filters serialize when set, absent when unset.
- DTO null-safety: DecisionExplanation policyMatches defaults to empty
  when constructor receives null; ExplainPolicy defaults.

Companion to platform v7.1.0 (axonflow-enterprise PR #1605), Go SDK
v5.4.0 (PR #122), Python v6.4.0 (PR #141), TS v5.4.0 (PR #175).
URLEncoder.encode() is application/x-www-form-urlencoded — spaces become
'+' rather than '%20'. That's wrong for a path segment: the server parses
the URL path segment-by-segment and '+' is a literal character there.
Go / Python / TypeScript all path-encode; Java was the outlier.

Fix by replacing '+' with '%20' in the URLEncoder output. That converts
the form-encoded string to a valid percent-encoded path segment, with
every other character (including literal '+' in the input -> '%2B')
handled correctly. Two regression tests lock in the semantics.
@saurabhjain1592 saurabhjain1592 merged commit 08b18cb into main Apr 18, 2026
9 checks passed
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