Skip to content

feat(validation): align request/response validation and harden parsing/metrics behavior#21

Merged
limehee merged 27 commits intomainfrom
feat/#20
Mar 5, 2026
Merged

feat(validation): align request/response validation and harden parsing/metrics behavior#21
limehee merged 27 commits intomainfrom
feat/#20

Conversation

@limehee
Copy link
Copy Markdown
Owner

@limehee limehee commented Mar 5, 2026

Summary

This PR completes the validation/options overhaul for JSON-RPC request/response handling and aligns Spring auto-configuration with core behavior.

Key updates:

  • Added symmetric request/response validation options in jsonrpc-core (ID rules, duplicate-member policies, field rejection policies).
  • Added strict duplicate-member parsing support via shared payload reader and wired it through core/webmvc/autoconfigure.
  • Exposed and bound response parser/validator options in Spring Boot auto-configuration.
  • Fixed autoconfigure precedence so custom JsonRpcRequestValidationOptions / JsonRpcResponseValidationOptions beans are honored consistently.
  • Added hard fail-fast constraints for invalid constructor/property inputs (including positive-only metric method-tag cap).
  • Enforced hard cap semantics for metric method-tag cardinality under concurrency.
  • Expanded tests across core/autoconfigure/webmvc/samples for success/failure/branch/concurrency paths.
  • Updated docs and metadata (configuration reference, migration mapping, sample guides, expected JSON outputs).

Related Issues

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Test
  • Build/CI

JSON-RPC Impact

Describe protocol-level impact, if any:

  • No protocol behavior change
  • Request validation behavior changed
  • Error mapping behavior changed
  • Method registration/dispatch behavior changed

Details:

  • Validation behavior is now more explicitly controlled through symmetric request/response options.
  • Duplicate-member rejection can be enforced consistently for request/response raw parsing paths.
  • Reserved method namespace (rpc.*) rejection and stricter fail-fast constraints are enforced where configured.
  • Default behavior remains RFC-oriented and documented; strict toggles are opt-in via configuration.

Validation

  • ./gradlew test
  • ./gradlew check
  • Added/updated tests for new behavior

Documentation

  • Updated README (if needed)
  • Added migration notes for breaking changes (if any)

limehee added 26 commits March 5, 2026 00:07
@limehee limehee self-assigned this Mar 5, 2026
@limehee limehee added the type: feature New feature specification and implementation. label Mar 5, 2026
@limehee limehee merged commit 06be21a into main Mar 5, 2026
5 checks passed
@limehee limehee deleted the feat/#20 branch March 5, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature New feature specification and implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Symmetric request/response validation keys and response error.code policy expansion

1 participant