Skip to content

Feat/runtime response validation - #482

Merged
Lakes41 merged 4 commits into
Adamantine-guild:mainfrom
Code-Paragon:feat/runtime-response-validation
Aug 30, 2026
Merged

Feat/runtime response validation#482
Lakes41 merged 4 commits into
Adamantine-guild:mainfrom
Code-Paragon:feat/runtime-response-validation

Conversation

@Code-Paragon

Copy link
Copy Markdown
Contributor

Description

Implements a lightweight, zero-dependency runtime response validation system to safely parse unknown API payloads and prevent invalid data from propagating through the SDK.

  • Created composable schema builders (string, number, boolean, null, literal, optional, array, object, union).
  • Implemented strongly typed parsing returning discriminated ValidationResult<T> objects.
  • Added structured path tracking (e.g., data.members[2].id) for descriptive validation failures.
  • Enforced strict depth limitation (max depth 20) to prevent recursive payload attacks or stack overflows.
  • Backed by 93 comprehensive unit tests covering primitives, nested objects, arrays, unions, and malformed responses.

Closes #467 (or respective issue number if applicable).

Type of Change

  • Bug fix (fix(scope): message)
  • New feature (feat(scope): message)
  • Documentation (docs(scope): message)
  • Refactoring (refactor(scope): message)
  • CI/CD (ci(scope): message)
  • Other

PR Title Format

This PR follows Conventional Commits:

Testing

  • Tests pass locally
  • New tests added (if applicable)

Checklist

  • PR title follows type(scope): message format
  • Code follows project style guidelines
  • Self-review completed

@Lakes41

Lakes41 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

This PR cannot be merged automatically because it has merge conflicts.

Please update the branch with the latest base branch and resolve the conflicts.

After the conflicts are resolved and checks pass, the automation can review it again.

@Lakes41
Lakes41 merged commit 5525a77 into Adamantine-guild:main Aug 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement an immutable SDK request context with scoped metadata propagation

2 participants